How can I change input of function from file to cell array?
1 view (last 30 days)
I have this function dfaedit_2('filename.csv',0,0,0) and it only takes files as input. I have a cell array with a size of 19x21.
I would like to change the input into a cell array.
When I run it however I get an error:
Error using cumsum
Invalid data type. First input argument must be numeric or logical.
Error in dfaedit (line 44)
Sum = cumsum(x);
Help is much appreciated!
David Hill on 26 Jan 2022
Edited: David Hill on 26 Jan 2022
Either delete or comment out lines below and change input to data. Verify cell2mat(of your cell array) gives what is expected. Or provide a sample of your input cell array and previous data file.
function [H]=dfaedit(data,plot_flag, outfile_flag, out_command_flag)
format short g
%x = file_name;
%fid = fopen(file_name);
%data = textscan(fid,'%f');
%fid = fclose(fid);
x = cell2mat(data);