Prev: Cannot install Matlab 2007a on Windows 7
Next: Installing NI USB-6009 into RT Windows Tgt Analog Input Block
From: amr sayed on 21 Nov 2009 13:16 Dear all i am stuck for 2 weeks in the same matlab problem i am trying to implement a level-2 s function for wavelet but i have the same error please anyone help me here is my code and error function amr11(block) setup(block); function setup(block) %% Register number of input and output ports block.NumInputPorts = 1; block.NumOutputPorts = 1; %% Setup functional port properties to dynamically %% inherited. block.SetPreCompInpPortInfoToDynamic; block.SetPreCompOutPortInfoToDynamic; block.InputPort(1).DirectFeedthrough = true; block.InputPort(1).Complexity = 'Real'; block.InputPort(1).DataTypeId = 0; block.InputPort(1).SamplingMode = 'Sample'; block.InputPort(1).Dimensions = 1; block.OutputPort(1).Complexity = 'Real'; block.OutputPort(1).DataTypeId = 0; block.OutputPort(1).SamplingMode = 'Sample'; block.OutputPort(1).Dimensions = 1; %% Set block sample time to inherited block.SampleTimes = [-1 0]; %% Run accelerator on TLC block.SetAccelRunOnTLC(true); %% Register methods block.RegBlockMethod('Outputs', @Output); function Output(block) u=block.InputPort(1).Data; [C,L] = wavedec(u,3,'dmey'); d1=appcoef(C,L,'dmey',3); block.OutputPort(1).Data= d1; %end %endfunction %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% the error is Error evaluating registered method 'Outputs' of M-S-Function 'amr11' in 'amr1/M-file (level-2) S-Function'. Invalid assignment in 'amr1/M-file (level-2) S-Function': attempt to assign a vector of width 88 to a vector of width 1. The following is the MATLAB call stack (file names and line numbers) that produced this error: ['C:\Users\amr sayed\Desktop\New Folder\tryme\amr11.m'] [61]. pls help i lost my mind |