|
"Chris Johnson" <donotuse@hotmail.com> wrote in message <h3q4lf$k3a$1@fred.mathworks.com>...
> The chance is that somewhere in your code you need to include a conversion. It basically involves a little bit of inventive codeing. Debug your m-file using breakpoints and examine the data it is trying to convert then use help to find out how to convert the data correctley. For example struct() can be used to convert data into a structured array.
>
> S = struct('A', {5, 'Anne', @myfun, 1:5});
>
>
> Without information about what exactley your doing this is the best I can do. But I expect that you trying to concatenate two matricies with different formats.
>
> I had a similar problem and this is the code that solved the problem for me. The file I load in is read in as a structured array and I wanted to add to it a string of the filename. To do this I converted each string to a cell before adding it to an array and once finished converted the remaing structered array to a cell array before joining the two arrays together as they were now both cell arrays.
>
> dat_l = [];
> dat_r = [];
> for i = startnum:endnum
> filename2 = [num2str(i),'.mat'];
> load(filename2)
> dat_l = cat(1,dat_l,[i, num_edges, num_def.left, num_def.right]);
> filename2 = cellstr(filename2);
> dat_r = cat(1,dat_r,filename2);
>
> end
> dat_l = num2cell(dat_l);
> global dat;
> dat = cat(2,dat_l,dat_r);
>
> set(handles.uitable1, 'Data',dat);
>
> I hope this helps
> Chris
I'm not sure what a fis file is but I've had a similar error before while using data structures in Simulink (error: expecting a uint16, found a double, or something to that effect). The problem wasn't anything to do with data types it was to do with data dimensions and I spent quite a while trying find out how my uint16 had unwittingly been converted. So just a word of warning, if Chriss's suggestion doesn't work then perhaps the error lies elsewhere!
|