syntax cellstr Error when using double as input argument
이전 댓글 표시
Hi there,
Octave does work correctly .
n = 4;
class(n)
ans = double
cellstr(n)
ans =
{
[1,1] =
}
I run the following code, I get the error shown below. At the same time Octave does work correctly .
Error using cellstr (line 49)
Conversion to cellstr from double is not possible.
n = 4;
class(n)
cellstr(n)
채택된 답변
추가 답변 (1개)
There is no point comparing two functions (with the same name) in two software and demanding one behaves the same way as the other. See "doc cellstr" in MATLAB for its syntax.
What do you expect cellstr(2) in MATLAB? Similar to zeros(2) or ones(2), or like below?
cellstr(["","";"",""])
In fact, what is the output of cellstr(4) in Octave? It was not clear for me to see from your post.
댓글 수: 2
Life is Wonderful
2022년 7월 14일
편집: Life is Wonderful
2022년 7월 14일
Walter Roberson
2022년 7월 14일
MATLAB is created by programming professionals who have full access to existing matlab source code, and have decades of institutional coding "best practices" and testing frameworks.
Octave is developed by volunteers in their spare time. They are, if I understand correctly, legally not permitted to examine whatever matlab source code might be visible, as that could be considered reverse engineering under the terms of the Mathworks licenses. They have to work based strictly on the published documentation, as there is legal precedent that published APIs can be duplicated in a "clean-room" development system. And the volunteers sometimes simply overlook matters such as proper type checking.
카테고리
도움말 센터 및 File Exchange에서 Octave에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!