How to select a column with a specific value of interest and include it into equations.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Matt J
el 5 de Nov. de 2020
f=@(t) sqrt(t-t.^2);
theta=acos(1-2*s);
G=alpha*Vinfinity*diff(theta+2*f(s));
4 comentarios
Matt J
el 7 de Nov. de 2020
Editada: Matt J
el 7 de Nov. de 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));
Ver también
Categorías
Más información sobre NaNs en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!