How to test function inputs for vector/scalar?
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!