0

I am beginner in Matlab, this is my code so far to plot function

A=[5:5:60];
alpha=[0:1:90].*(pi/180);
omega=[24];
for k = 1:12
    A1=A(k);
    B=[0:A1./5: A1];
    for j = 1:6
        for i = 1:91
            I(k,j,i)=A(k)+B(j)*sin(2*alpha(i)+omega)*sin(2*alpha(i)+omega);
        end
    end
end

figure(1), plot(alpha, squeeze(squeeze(I(6,3,:))))

How do I plot relation between A and b from each I at a set A and B.

and to use max and min functions to get Imax and Imin.

And then I want to calculate PI, then plot PI vs (A,B) on a 3d plot.

can any one help?

  • 1
    This seems like multiple questions. To start, the [`max`](https://www.mathworks.com/help/matlab/ref/max.html) and [`min`](https://www.mathworks.com/help/matlab/ref/min.html) functions work similarly. The second output is the index of the maximum: `[M,I] = max(A)`. See [How can I find the maximum value and its index in array in MATLAB?](https://stackoverflow.com/q/13531009/8239061) – SecretAgentMan Oct 29 '19 at 17:37
  • @SecretAgentMan it does not give the max nor the min, for the functon – sara milan Oct 29 '19 at 17:47
  • @SecretAgentMan a trying to find min max for the function ploted, which is look like sinus function repeated – sara milan Oct 29 '19 at 17:49

0 Answers0