Advertisement
Guest User

matlab table help

a guest
Apr 7th, 2020
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.50 KB | None | 0 0
  1. for loop = 1:2
  2.     for xmouse = 1:3
  3.         clearvars mystruct
  4.         mystruct.name = 'dream';
  5.         mystruct.var = 112;
  6.        
  7.         if loop == 2
  8.             mystruct(2).name = 'seizmore';
  9.             mystruct(2).var = 1200;
  10.         end
  11.        
  12.         if xmouse == 1 && loop == 1
  13.             mytable = struct2table(mystruct);
  14.         else
  15.             table2append = struct2table(mystruct);
  16.             mytable = [mytable; table2append];
  17.         end
  18.     end
  19.     mytable.name
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement