Using a script with different inputs from a table

I have a script which has an input x. I have a table n with various numbers. I want the script to be executed in such a way that the numbers from table n are used in each instance. For example, n= 3,74,53,8,53
Then run the script once with x=3, after displaying the results run the script again but with x= 74... And so on. Has anyone got an idea how I can process this automatically?
Thanks

댓글 수: 1

You should use a function instead of a script. Then you can pass arguments into it and run it multiple times if needed. Or have the function run on a table/vector of inputs itself so that it produces multiple answers rather than calling it multiple times.

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

AA
2015년 6월 30일

댓글:

2015년 6월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by