how to define class for basic functions like disp, load save
Ältere Kommentare anzeigen
i am calling classdef in a program and once called basic functions like disp, save, load does ot work. do i need to define any class for them. pl. guide
7 Kommentare
Jacob Halbrooks
am 17 Jan. 2014
Do you mean that the default disp, save, and load do not work for your class? Could you clarify? Depending on your class and its properties, you might need to implement your own load/save logic. However, I would expect disp to "work" by default.
Ashish
am 17 Jan. 2014
Walter Roberson
am 17 Jan. 2014
I am not clear... is it the case that you have a .m file that has regular functions and also has a classdef inside it? A classdef needs to be in a file of its own.
Ashish
am 18 Jan. 2014
Jan
am 19 Jan. 2014
Please post more detailed, what you are doing. "use disp" is not clear enough to understand, where a compilation error comes from. Do you get an error message?
Ashish
am 26 Jan. 2014
Antworten (2)
When I run your code, I have no problem displaying invoking the default disp.
>> obj=vrt_gen; disp(obj)
vrt_gen with properties:
hdr: []
trailer: []
word0: []
psize: []
stream: 0
int_ts: []
frac_ts_0: []
frac_ts_1: []
count: []
nSamples: []
nPkts: []
pkt: []
pkts: []
payload: []
lpf: []
symbols: []
dsymbols: []
M: []
N: []
fs: []
ts: []
fc: []
time: []
upsample: []
mixed: []
filt_y: []
filt_t: []
filt_type: []
filt_beta: []
filt_Fd: []
filt_Fs: []
scheme: []
h: []
g: []
filtered_sig: []
What is the full path to your main_file.m?
Image Analyst
am 26 Jan. 2014
0 Stimmen
You don't have any methods in your class. And disp() doesn't even appear anywhere in the file. No, you do not need a class to use disp, save, and load. You can use them just by themselves. Not sure what you're doing tor attempting to do.
Kategorien
Mehr zu Class Introspection and Metadata finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!