フィルターのクリア

How can I see Matlab code (.mat) when we have .m?

13 ビュー (過去 30 日間)
Trung Hieu Le
Trung Hieu Le 2016 年 6 月 12 日
編集済み: Trung Hieu Le 2016 年 6 月 12 日
Hi Everyone!
Regards Matlab's data, I found two function file ".m". I wonder that can I see Matlab code (.mat) from two these files for running?
I already tried but it did not work.
Thanks in advance for your help.

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 6 月 12 日
編集済み: Azzi Abdelmalek 2016 年 6 月 12 日
.mat file doesn't contain a code, it contains data, if you want to see those data, type
data=load('YourFile.mat')
%or
data=load('YourFile')
%or
load YourFile
  1 件のコメント
Trung Hieu Le
Trung Hieu Le 2016 年 6 月 12 日
編集済み: Trung Hieu Le 2016 年 6 月 12 日
Could you make a sample "adata" which these files can use? Which format of adata should it be in this code? Because I'm trying with double array, table but it is always faced with errors: Undefined operator '==' for input arguments of type 'table'.
Thanks

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


John D'Errico
John D'Errico 2016 年 6 月 12 日
Huh? Those are m-files, scripts in this case. You can edit it with any text editor, including the edit command in MATLAB. You can use type on the functions in MATLAB to show them on the command line.
A .mat file is not MATLAB code. It is a file containing data, MATLAB variables.
Of course, if you have actually named your m-files with spaces in the name, they will be unusable in MATLAB. Also uneditable. That will teach you to change the names to something that IS a legal m-file name:
- NO spaces in the names
- NO special characters. a "-" for example, is an impossibility.
- NO names that start with a numeric character.
A few other rules that I'm probably forgetting. For example, there is a limit on the number of total characters in the name. The computer system you are on and the MATLAB version may impact that number, since older releases were much more restrictive there.

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by