- #1
anon0219
- 1
- 0
Hi,
I am writing a program where I have the user input the name of two previously created vectors, the computer subtracts them and then generates a variable in the workspace. I was wondering if there was a way to let the user pick this name. I have so far (Y and N have been previously defined as 1 and 0):
subtract_data=input('Would you like to subtract any data sets? Y/N');
if subtract_data == 1
higher=input('Enter the name of the spectrum you would like to subtract from');
lower=input('Enter the name of the spectrum you are subtracting');
new_data=higher-lower;
filename=input('Input file name: ', 's');
...?
end
I am not sure where to go from here how to get the variable new_data to be titled what the user inputs as filename.
thanks
I am writing a program where I have the user input the name of two previously created vectors, the computer subtracts them and then generates a variable in the workspace. I was wondering if there was a way to let the user pick this name. I have so far (Y and N have been previously defined as 1 and 0):
subtract_data=input('Would you like to subtract any data sets? Y/N');
if subtract_data == 1
higher=input('Enter the name of the spectrum you would like to subtract from');
lower=input('Enter the name of the spectrum you are subtracting');
new_data=higher-lower;
filename=input('Input file name: ', 's');
...?
end
I am not sure where to go from here how to get the variable new_data to be titled what the user inputs as filename.
thanks