Quantcast
Channel: MATLAB Central Newsreader - tag:"variables"
Viewing all articles
Browse latest Browse all 41

Re: Program with different cases

$
0
0
On 6/21/2016 8:54 PM, ROJI wrote:
> I'm writing a program that should allow a user to pick from a list of 20 different mathematical cases.
>Once the case has been selected they are allowed to input 6 different variables.
>After that the program should use the numbers and the case selected and do the computation.
> How do I start on this? and are there any examples like this?
>


Matlab has switch, case, otherwise which you can use for this

http://www.mathworks.com/help/matlab/ref/switch.html

ALso if, elseif, else can be used

http://www.mathworks.com/help/matlab/ref/if.html

Examples on the above pages.

Viewing all articles
Browse latest Browse all 41

Trending Articles