필터 지우기
필터 지우기

Looping a function in MATHLAB

조회 수: 3 (최근 30일)
Prince Igweze
Prince Igweze 2020년 4월 4일
답변: David Hill 2020년 4월 4일
Please, how can I loop this function
function y = f(x)
y = sqrt(1 - (x^2)*(Z^2));
end
to solve for different values if Z (ie Z(i))
Thank you

답변 (1개)

David Hill
David Hill 2020년 4월 4일
No loop needed, just provide Z array to function. Output, y will contain the array of corresponding outputs for the different Z's given the x-value.
function y = f(x,Z)
y = sqrt(1 - (x^2)*(Z.^2));
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by