Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

can't invoke static methods in Matlab 7.1.0.246(R14)

조회 수: 1 (최근 30일)
wei du
wei du 2016년 5월 20일
마감: MATLAB Answer Bot 2021년 8월 20일
This is a simple .m file. Saved to "temp.m".
In Matlab 7.12.0 (R2011a), I can just call temp.t0() or temp.t1(), it will print the expected results. But in Matlab 7.1.0.246(R14). It shows this error:
>> temp.t0()
??? The function, script, or class temp
cannot be indexed using {} or . indexing.
Is it because Matlab version is low, and it doesn't support to invoke static methods?
Below is the source code of temp.m
classdef temp
methods (Static)
function [] = t0()
fprintf('function t0\n');
end
function [] = t1()
fprintf('function t1\n');
end
end
end
  댓글 수: 1
per isakson
per isakson 2016년 6월 11일
AFAIK: The support for classdef first appeared in R2008a

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by