Getting "Unrecognized function or variable 'reshape'" error!!

I am running R2021b and using simple reshape function.
But Matlab is giving Unrecognized function or variable 'reshape'".
I checked for the path of this function and its present in the path values.
Any idea what could be wrong.

3 件のコメント

DGM
DGM 2022 年 5 月 26 日
How are you using it, and of what class is the object you're passing to it?
KSSV
KSSV 2022 年 5 月 26 日
Show us the code you tried.
Kumar Vishal Rai
Kumar Vishal Rai 2022 年 5 月 27 日
I am using following code:
reshape([1 2 3 4],:,1);
and getting the error!!

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

 採用された回答

Walter Roberson
Walter Roberson 2022 年 5 月 27 日

1 投票

reshape([1 2 3 4],:,1);
Notice the : . : by itself can only appear (a) in comments; (b) in character vectors; (c) in string() objects; or (d) as a subscript for a variable. So in context, that code would require that "reshape" is a variable. But reshape is not a variable in your code.
Perhaps you were looking for
reshape([1 2 3 4],[],1)

その他の回答 (1 件)

Chunru
Chunru 2022 年 5 月 27 日

0 投票

%reshape([1 2 3 4],:,1);
reshape([1 2 3 4], [], 1) % use [] for auto computed size
ans = 4×1
1 2 3 4

カテゴリ

製品

リリース

R2021b

質問済み:

2022 年 5 月 26 日

回答済み:

2022 年 5 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by