Skip to content

Instantly share code, notes, and snippets.

@Privilger
Created February 26, 2020 03:52
Show Gist options
  • Save Privilger/a27b0576509d5fe36664735d69a47ea4 to your computer and use it in GitHub Desktop.
Save Privilger/a27b0576509d5fe36664735d69a47ea4 to your computer and use it in GitHub Desktop.
Matlab编程技巧
%% 变量的变量
data = [2, 3, 4, 5];
for m = 1 : 4
name_string = ['s' num2str(m) ' = data' '(' num2str(m) ')'];
eval(name_string)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment