Automatically Run Script MatLab

5 ビュー (過去 30 日間)
Eva Comeni
Eva Comeni 2021 年 5 月 27 日
編集済み: Eva Comeni 2021 年 5 月 28 日
Come posso fare per scrivere uno scripts matlab che restituisca gli elementi di una matrice in coppia?
Se scrivo A = [1 2 3; 4 5 6; 7 8 9]; crea la matrice ogni volta.
Se scrivo: load ('filename.mat') Error using load
Unable to read file 'Filename.mat'. No such file or directory.
Posso visualizzare la matrice solo se la digito sulla command window

採用された回答

Image Analyst
Image Analyst 2021 年 5 月 27 日
Is your mat file called "filename.mat"? Or do you have the actual name in filename, like
filename = 'abc.mat';
? If filename is one of your variables, try this:
s = load(filename) % Load structure containing all the variables in the .mat file.
  3 件のコメント
Image Analyst
Image Analyst 2021 年 5 月 28 日
OK. Good luck. Write back if you have any questions, and attach your code and .mat file.
Eva Comeni
Eva Comeni 2021 年 5 月 28 日
編集済み: Eva Comeni 2021 年 5 月 28 日
Sorry, I forgot to ask you how I write my code. I wrote this code:
A = load('filename.mat');
X = rand(A);
But i have this error: "Error using rand. Size inputs must be numeric."
Why? What is the correct code, to generate a permutation matrix (the matrix above) without repetitions?

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!