I may be a newbie in matlab have a small problem with a libray in matlab : I don't know if there a function is_array in matlab.
Error in tt_tensor (line 183) if is_array(varargin{1})
My code worked somme weeks ago but didn't work since yesterday.
If someone could help me, I will be gratfull.

 채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 12월 11일
편집: KALYAN ACHARJYA 2020년 12월 11일

0 개 추천

No, there is no "Is_array" inbuilt function in MATLAB, there is "isvector" inbuilt function
isvector(data) returns logical 1 (true) if data is a vector. Otherwise, it returns logical 0 (false).
More: There is "uiarray" function, this function is used primarily for creating UI controls of demos of the toolbox.
Deatail, please check
>> help uiarray

댓글 수: 6

Hi KALYAN,
Thank you for the answer. The problem is that i'm using a function tt-factor() from tt-toolbox library. And the problem is that I can't manipulate this function because it needs is_array().
So probably function didn't exist in matlab, but it exist in c++, so can I use std library cpp in matlab ?
Finaly I decide to use the comnation isvector(size(x)) instead of is array.
Thanks for the help.
KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 12월 11일
Welcome
:)
Zeng
Zeng 2026년 3월 3일 7:25
편집: Walter Roberson 2026년 3월 3일 7:51
I encounter the same problem when using TT-toolbox ( https://github.com/oseledets/TT-Toolbox ). I guess maybe there is a time when is_array is usable in matlab but now we can only use ismatrix as a substitute? Since array in python behave just same as matrix, and in matlab we always call a n-dimensional thing a matrix. Just curious whether this is an explanation.
Walter Roberson
Walter Roberson 2026년 3월 3일 9:05
I doubt that there was ever a function named is_array in the remote past. Functions named with an underscore is not Mathworks style for core functions; Mathworks would have used isarray
Stephen23
Stephen23 2026년 3월 3일 12:25
"in matlab we always call a n-dimensional thing a matrix"
No, we never call a n-dimensional thing a matrix. The MATLAB documentation states "All MATLAB variables are multidimensional arrays, no matter what type of data. A matrix is a two-dimensional array often used for linear algebra."
So a matrix is just an array where all dimensions >2 are scalar. This matches exactly the definition used by ISMATRIX, which states that "A matrix is a two-dimensional array that has a size of m-by-n, where m and n are nonnegative integers."
Using an incorrect definition of matrix is likely to caus a lot of confusion, as your comment indicates.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2020년 12월 11일

댓글:

2026년 3월 3일 12:25

Community Treasure Hunt

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

Start Hunting!

Translated by