How to make a matrix from a for loop
Afficher commentaires plus anciens
I need to store the values given in a matrix so I can make a graph, but I cant figure it out. Please help! I only want to graph the positive values.
clc
clear
for t = 0:2:100;
h = rocket(t);
if h>=0
disp(h)
end
end
%My function
function [h] = rocket(t)
h = (60+(2.13*(t^2))-(0.0013*(t^4))+(0.000034*(t^4.751)));
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!