필터 지우기
필터 지우기

How to select a column with a specific value of interest and include it into equations.

조회 수: 1 (최근 30일)
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.

답변 (1개)

Matt J
Matt J 2020년 11월 5일
f=@(t) sqrt(t-t.^2);
theta=acos(1-2*s);
G=alpha*Vinfinity*diff(theta+2*f(s));
  댓글 수: 4
Avenger2020
Avenger2020 2020년 11월 7일
I'm so confused. Is vector s suppose to be 1-100? and what does the f=@(t) mean?
Matt J
Matt J 2020년 11월 7일
편집: Matt J 2020년 11월 7일
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));

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 NaNs에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by