Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

1 Ansicht (letzte 30 Tage)
wei du
wei du am 20 Mai 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
per isakson
per isakson am 11 Jun. 2016
AFAIK: The support for classdef first appeared in R2008a

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by