I am using MATLAB to process data from files. I am writing a program that takes input from the user and then locates the particular files in the directory graphing them. Files are named:
{name}U{rate}
{name} is a string representing the name of the computer. {rate} is a number. Here is my code:
%# get user to input name and rate
NET_NAME = input('Enter the NET_NAME of the files: ', 's');
rate = input('Enter the rate of the files: ');
U = strcat(NET_NAME, 'U', rate)
load U;
Ux = U(:,1);
Uy = U(:,2);
There are currently two problems:
When I do the
strcat
with say 'hello', 'U', and rate is 50, U will store 'helloU2' - how can I getstrcat
to append {rate} properly?The load line - how do I dereference U so load tries to load the string stored in U?
Many thanks!