Can't call function within class
19 views (last 30 days)
Show older comments
Manash Sahoo on 16 Apr 2020
Commented: Cedric Wannaz on 16 Apr 2020
Hi everyone. First time posting here. I have a matlab class of a signal which comprises parts x, y, sampling rate (Fs), and Color. I have also defined a function within the methods of the class for resampling the signal and building a new x axis for the resampled data. However, I'm unable to call this function even after creating an object.
Using R2019b. The code is as follows:
function resamp_x,resamp_y = resamp_sig(obj);
resamp_x = 1/obj.Fs:1/obj.Fs:numel([obj.signal_y])/obj.Fs;
resamp_y = abs(resample([obj.signal_y],[obj.signal_x],obj.Fs));
You forgot to bracket the output args, and the semi-column is useless:
function [resamp_x,resamp_y] = resamp_sig(obj)
More Answers (0)
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!