how would one use logic commands to run separate function files with single-statement intput?
Show older comments
So I am trying to create a ballistic calculator as a class project, and I am trying to make it as user friendly as possible. I have a couple of function files with the equations relevant to the cartridges we made ourselves based on charts and I would like to call on them using logic via input in the command window. I found you can simply run a file by using the run command, but we haven't covered this in class and so the nomenclature is a struggle for me.
the file name is c223 for .223 rem. and i haven't uploaded the other files my teamates are working on. so i have the program display arbitrary text values until i can upload them in. I'm just trying to get this to work.
this is what i have so far, can someone please help me understand how to convince matlab to run the function file by entering ".223" into the command window?
thanks!
%project draft
clear, close all, format compact, clc
disp('select caliber (.223, .270 win):')
run(f)
switch f
case .223
f=c223.m
case .270
cal=disp('ok')
otherwise
cal=disp('no')
end
Accepted Answer
More Answers (0)
Categories
Find more on Scope Variables and Generate Names 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!