I don’t know how can I ask this question properly. Hope you will understand what I mean. I have a code in Matlab, and I’ve different processes. For example, if I use some tye of image (for example, *.bmp) I have to run some code in Matlab and if I have another type of image (*.jpg) I want to run another part of the code.
But, what I want to do is that at the beginning of the code Matlab asks ‘what kind of image?’ (for example, with the comand ‘disp), and then I would write ‘bmp’ or ‘jpg’ and run the related code. I prefer not using a loop, just ‘write’ the word, and it could identify the process.
How can I do it?
Use functional, structured programming:
Put this all in a single file. Then you can call the function in Matlab by typing
where of course,
[some input args]etc. should be replaced everywhere with actually useful entities 🙂