Guest User

Untitled

a guest
Jan 22nd, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. *Variables* *Value* *Type*
  2.  
  3. Time [100X1] double
  4.  
  5. Force [100x1] double
  6.  
  7. *Variables* *Value* *Type*
  8.  
  9. Time_1 [90X1] double
  10.  
  11. Force_1 [90x1] double
  12.  
  13. %# get a listing of all save files
  14. fileList = dir('file*');
  15. nFiles = length(fileList);
  16.  
  17. loadedData = cell(nFiles,2); %# for storing {force,time}
  18.  
  19. %# loop through files and write results into loadedData
  20. for iFile = 1:nFiles
  21. tmp = load(fileList{iFile});
  22. loadedData(iFile,:) = struct2cell(tmp)';
  23. end
  24.  
  25. %# catenate
  26. time = cat(1,loadedData(:,2));
  27. force = cat(1,loadedData(:,1));
  28.  
  29. Time_1 = [1; 2];
  30. Time_2 = [2; 3];
  31. Time_3 = 4;
  32. All = [];
  33. for i = 1:3
  34. CurTime = eval(horzcat('Time_', num2str(i)));
  35. All = [All; CurTime];
  36. end
Add Comment
Please, Sign In to add comment