MATLAB: How to work rdivide function

MATLABmatrix array

Hi Everone,
I have a question in relation to the rdivide function.
I tried to use the rdivide function with two arrays but the program only provided a resultant array without any vauable result, not even zeros!!
Please refer to the following what expression I used initially and after to circumvent the shortage of computation one by one of array elements:
R = rdivide(abs(i_min_1(1,1)),i_max_1(1,1));
It only worked by simple but very struggle way, piece by piece as it goes:
r_1=abs(i_min_1(1,1))/i_max_1(1,1);
Please let me know what could go wrong with it.
Many thanks in advance.
Andras

Best Answer

Please don't post answers to questions as you did to another question when you just want to ask a question.
Regardless, it looks like your question (confusing as it is) asks how to divide the elements of two arrays.
Use the ./ operator to do this.
A = rand(10);
B = rand(10);
C = A./B;
that is, if you want to operate in an element-wise way on two arrrays, then use the operators ./ and .* and .^ for that. Similarly, if you want to compute the reciprocal of all elements of a vector:
x = 1:10;
reciprocalx = 1./x;
The / and * and ^ operators are used for matrix algebra, not for simple element-wise operations.
But really, if you are asking questions like this, you need to read the getting started tutorials in MATLAB.