Vector as an input in function
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Valentina Richard
il 29 Mag 2022
Commentato: Valentina Richard
il 31 Mag 2022
I am asked to create a function where one of the inputs is a vector containing parameters a and b (these are parameters of an equation f(x)).
I tried naming the vector v and then defining the vector before inputting the f(x) but it doesnt work. Can anyone help me on this please?
0 Commenti
Risposta accettata
Più risposte (1)
the cyclist
il 29 Mag 2022
Modificato: the cyclist
il 29 Mag 2022
a = 2;
b = 3;
v = [a; b];
f_out = f(v)
function out = f(v)
out = 5*v(1) + 7*v(2);
end
1 Commento
Anas Saleh
il 30 Mag 2022
Modificato: Anas Saleh
il 30 Mag 2022
please can you answer this question? I will appreciate that.
https://www.mathworks.com/matlabcentral/answers/1730385-image-processing-thresholding-images-to-obtain-image-with-the-required-gray-values
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!