Hello everyone!
I have two simple questions in data analysis:
1) I have z, a 17*1 matrix, for each value of z, I want to find B (another 17*1 matrix) according to the code:
u0 = pi*4E-7;
N = 300;
I = 1;
L = 160E-3;
b = 16.5E-3;
a = z + L/2;
c = z - L/2;
B = (u0*N*I/2*L)*((a/sqrt(b^2 + a^2))- (c/sqrt(b^2 + c^2)));
Now, I will get the error:
??? Error using ==> mpower
Matrix must be square.
so, I change it to a.^ and c.^, but now I will get B as 17*17 matrix and this is not what I need. How can I find B once for each value of z (like we do in Excel).
2) Second question:
I have x = Ay , if I have -for example- experimental values of x and y I got it from an experiment and plot the points and I want to compare them with the theoretical line. How can I plot the the theoretical line on top of the Experimental values on the same graph (Note: x first have discrete specific values, and now I want x for example like: 5:0.01:10) ?
Sorry for the bad English..