MATHWORKSの​Webにあるwrit​ematrixの例題​でエラーが出ます

8 views (last 30 days)
Hitoshi Inokawa
Hitoshi Inokawa on 31 Jul 2020
Commented: michio on 31 Jul 2020
MATLAB2020aを使用しています。
witematrixの使い方を知るために、
にある例題をコピー・ペーストして行ってみたのですが、下記のようにエラーが出ます。
何が良くないのでしょうか。ご教示いただけると助かります。
よろしくお願いいたします
>> M = magic(5)
M =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
>> writematrix(M)
入力引数が不足しています。
例題が正しいと下記のようになるようです
ここから-----------------------------
M = magic(5)
M = 5×5
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
writematrix(M)
type 'M.txt'
17,24,1,8,15
23,5,7,14,16
4,6,13,20,22
10,12,19,21,3
11,18,25,2,9
ここまで--------------------------------

Answers (1)

michio
michio on 31 Jul 2020
1つ考えられるのは別(自作?)の writematrix 関数が呼ばれている可能性ですが、念のため確認頂けますか?
which -all writematrix
と実行して一番上に
C:\Program Files\MATLAB\R2020a\toolbox\matlab\iofun\writematrix.m
が出てきているかどうかですが・・(MATLAB のインストール先によって冒頭は異なりますが toolbox 以下は一致するはずです。)
  2 Comments
Hitoshi Inokawa
Hitoshi Inokawa on 31 Jul 2020
ご返信ありがとうございます。
ご指摘の通り、他にwritematrixが存在していました。
削除して無事MATLABのwritematrix関数が呼ばれるようになりました。
解決いたしました。
ありがとうございました。
michio
michio on 31 Jul 2020
よかったです! ご連絡ありがとうございました。

Sign in to comment.

Categories

Find more on データのインポートとエクスポート in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!