Multiple variable inputs for a function
1 ビュー (過去 30 日間)
john smith 2021 年 4 月 10 日
コメント済み: Rena Berman 2021 年 5 月 6 日
[function of x,y,a,b,P,f]=...
w= stored outputs from the function above
I am having an issue with being able to vary 'i' and thus the inputs that correspond with 'i' whilst also changing the inputs corresponding to 'q' for each respective 'i.' ie if i represents the months january to june and f represents multiple locations. I would like to find the outputs of the function at every location for each month and thus for each x and y. Hopefully that makes sense any advice would be appreciated as I am not too familiar with for loops or/ if they are even needed here. 'from the function above' shouldnt be purple but i cant change it
I need to know how when i=1 and q=1,2,3,4...50. what the function would be equal to at each location vector,f and then do the same for i=2 q=1,2,3,4...50 and so on. More the process behind how than the specifics..
回答 (1 件)
Ayham Aljawabrah 2021 年 4 月 10 日
編集済み: Ayham Aljawabrah 2021 年 4 月 10 日
The logical order of the code is not correct and the function definition as well. A guide code can help you to reconstruct your code
u= @(x,y,a,b,f) -Enter_your_function_here-
b=[x1,y1,z1] % x1,y1,z1 are not apperent in the code, make sure to declare them
f(3)=e(q,3);% e is not apperent in the code, make sure to declare it
w=u(x,y,a,b,f) % this line depends on the function u output structure
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!