Hi,
I have a logical from one .m file that i would like to transfer to another.m file. I have tried copying and pasting, but it does not seem to be valid.
Any advice?

4 件のコメント

Walter Roberson
Walter Roberson 2019 年 10 月 11 日
So if you have a line of code such as
abc = [true, false, false, true, true];
and you copy the line and paste it into the other .m file, then you would not get the same line output? What would you get instead?
Cside
Cside 2019 年 10 月 11 日
i have a 600 x 8 logical and want to manipulate this in the new .m file. it was returned with an invalid expression in the command window. Where should I be copying into?
Walter Roberson
Walter Roberson 2019 年 10 月 11 日
Are you sure that it is in the form of commands in a .m file at the moment? And not data that you are displaying to the command window?
Cside
Cside 2019 年 10 月 11 日
i was copying the data prior, apologies. I have tried clicking on the logical in the other .m file and COPY, and pasted in the new .m file but the matlabimport tool popped up. Is there something i can type in the command window (in the new .m) to extract that logical in the old .m?

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

 採用された回答

Walter Roberson
Walter Roberson 2019 年 10 月 11 日

0 投票

mat2str(NameOfVariable)
Should give you a character vector that you can copy and paste

1 件のコメント

Cside
Cside 2019 年 10 月 12 日
thank youu :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Programming についてさらに検索

質問済み:

2019 年 10 月 11 日

コメント済み:

2019 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by