How to test function inputs for vector/scalar?
Ältere Kommentare anzeigen
I am coding for an assignment in which I have a function. The function has 3 inputs. The first two inputs need to be combined in a single vector for their input, and the other input is a scalar. The first thing my function needs to do is test if the inputs are in the correct format (the first 2 inputs being in a single vector and the third input being a scalar). I would prefer to use an IF statement to do this test, so how does one test for wether the inputs are the correct format?
For a bit of background, here is my function definition
function [wire_length,spring_mass] = spring_length_mass([inner_diameter outer_diameter],number_coils)
it would then go into the IF statement to test for proper input format.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!