How to select a column with a specific value of interest and include it into equations.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can i write the equation below into matlab? Alpha is given and Vinfinity is also given. The part that i'm confused about is the si, si-1, thetai and thetai-1. I have a list of 100 values in a column and i want to write a code that selects a value that i will enter to be selected as si. Then whatever row in that column that value was it will minus the value in the previous row (this will be si-1). Same principle for the theta's. Please see below for the equation.
0 commentaires
Réponses (1)
Matt J
le 5 Nov 2020
f=@(t) sqrt(t-t.^2);
theta=acos(1-2*s);
G=alpha*Vinfinity*diff(theta+2*f(s));
4 commentaires
Matt J
le 7 Nov 2020
Modifié(e) : Matt J
le 7 Nov 2020
Yes, s is meant to be a vector of length 100, or however many values you have. The result, G, will be a length-99 vector because there are ninety-nine differences . The expression,
f=@(t) sqrt(t-t.^2);
is an anonymous function. It is just a quick way of defining a short function. In hindsight, I could just as well have written,
theta=acos(1-2*s);
G=alpha*Vinfinity*diff(theta+2*sqrt(s-s.^2));
Voir également
Catégories
En savoir plus sur NaNs dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!