From: Peter Smith on
Hi all

i am having a problem linking together matrices.
Basically i have three matrices of the same dimentions 400*93

one matrix contains data on spreads - if the spreads are negative the element reads NaN.

However i want to basically tell matlab, if the matrix element = NaN, i want the same element in the ask matrix and the bid matrix to also read NaN and therefore overwrite the data that is in that particular element of the ask or bid matrix

Can anyone suggest any help?
From: Pekka Kumpulainen on
"Peter Smith" <fe09ae(a)mail.wbs.ac.uk> wrote in message <i3tm0l$6ur$1(a)fred.mathworks.com>...
> Hi all
>
> i am having a problem linking together matrices.
> Basically i have three matrices of the same dimentions 400*93
>
> one matrix contains data on spreads - if the spreads are negative the element reads NaN.
>
> However i want to basically tell matlab, if the matrix element = NaN, i want the same element in the ask matrix and the bid matrix to also read NaN and therefore overwrite the data that is in that particular element of the ask or bid matrix
>
> Can anyone suggest any help?

First, read "Matrices and arrays" in the Getting Started section of documentation.
Then doc isnan.
Then you can do something like this
inds = isnan(spreadmatrix);
ask(inds) = nan;
bid(inds) = nan;
From: Peter Smith on
thanks, you are the man