conversion to cell from double is not possible. in matlab

You can use the num2cell function to convert a double to a cell array. For example:

main.m
my_double = 3.14;
my_cell = num2cell(my_double);
49 chars
3 lines

If you want to convert an array of doubles to a cell array, you can use the num2cell function with the array as an argument.

main.m
my_array = [1.1, 2.2, 3.3];
my_cell_array = num2cell(my_array);
64 chars
3 lines

If you get an error message saying "Conversion to cell from double is not possible", make sure that you are not trying to assign the result to a numeric variable. In other words, make sure that you are using the correct type of variable to store the result of the conversion.

related categories

gistlibby LogSnag