Hello team !
So i am making an app, where the user can load a .mat file of diffrent driving profiles. This means that the user file name can be anything. so we can not specify the name of the file to be loaded and use just
load('WLTC_Driving_Cycle.mat')
So the idea is, to use fileName to get the name what ever is the name of the .mat file, and then load it. here is my code
fileName = uigetfile('*.mat');
load(fileName)
Speed = fileName.Data;
for i= 1 : length(speed)
s(1,i) = i-1;
s(2,i) = speed(i);
end
As we can see, i am not sure how to extract the data from the file, one idea is to do this :
temp = load(fileName)
speed (1,:) = temp.fileName.Data
0 Comments
Sign in to comment.