Can you have a if statement for even/odd?
79 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Patrick Scott
am 26 Mär. 2022
Bearbeitet: Patrick Scott
am 26 Mär. 2022
I would like to have this function check my input matrix if it is an even or odd length and then return a specific value. I'm going to write something more complex for the z_bar later on but this is the just of the function.
function [z_bar]=fnZbar(height)
if length(height)==even
z_bar= 1;
else
z_bar = 2;
end
end
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!