How to get one output for each input into an equation in MATLAB?

조회 수: 7 (최근 30일)
Ahmed Ali
Ahmed Ali 2021년 11월 9일
답변: Alan Stevens 2021년 11월 9일
I am trying to create an array of all output values for each value of the 'x' array that is plugged into the 'mu' equation using MATLAB. Right now I am only getting one output value. How do I change my code so I get one output value for each input value of 'x' after it is plugging into the 'mu' equation?
Code:
x = [0, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200];
y = [27 30 35 40 45 50 65 70 75 80 83];
mu_max = 0.0383 ;
Ks = 145 ;
mu = mu_max * (x/(x+Ks))

답변 (1개)

Alan Stevens
Alan Stevens 2021년 11월 9일
mu = mu_max * (x./(x+Ks)); % Notice it is ./ not just /

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by