|
"Bal kishore Pandey" <balkishore.pandey@gmail.com> wrote in message <ja3bmu$b8o$1@newscl01ah.mathworks.com>...
> Dear matlab users,
> I have an querry on how to convert a specific row or column value of a martix into NaN.
> For eg: i have a 5x5 matrix. And i want the values in the 2,3 row and 2,3 column to be NaN.
> To do this i write.
> a(2:3,2:3)={NaN};
> But when i execute it, i get an error
> ??? The following error occurred converting from cell to double:
> Error using ==> double
> Conversion to double from cell is not possible.
>
> Is there any other way this could be accomplished?
>
> P.S this is just an example matrix, the matrix i am going to implement this is a 1000x800 matrix. And i want row 20 to 225, 455 to 465, 740 to 760 and coloumn is any random value from 1 to 800.
remove the curly brackets.
a = ones(5)
a(2:3, 2:3) = nan
|