How to tabulate the values?
    12 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
I=[-40 -30 -20 -10 0 10 20 30 40];
w=[0.035 0.5 1 1.25 1.5];
h=1.57;
I_len=length(I);
w_len=length(w);
for b=1:w_len 
  d=w(b);
for c = 1:I_len 
a = I(c);
T=215.3*a^2*d^-1.5*h^-1;
end
end
This is my code.
how do I tabulate the results of a,d,h,T and plot the graph for the same?
0 commentaires
Réponse acceptée
  KSSV
      
      
 le 18 Juin 2019
        I=[-40 -30 -20 -10 0 10 20 30 40];
w=[0.035 0.5 1 1.25 1.5];
h=1.57;
I_len=length(I);
w_len=length(w);
T = zeros(w_len,I_len) ;
for b=1:w_len
    d=w(b);
    for c = 1:I_len
        a = I(c);
        T(b,c)=215.3*a^2*d^-1.5*h^-1;
    end
end
[X,Y] = meshgrid(I,w) ;
surf(X,Y,T)
4 commentaires
Plus de réponses (1)
  Shubham Sangle
      
 le 18 Juin 2019
        Your question is not clear.
1:Graph between what parameters you want to plot?
2:In your For loop you are assigning every element of array to variable d and b. You are neither using them anywhere nor storing them. what you want to do with those  variable?
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!