Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Adding Text columns to a Matrix
Date: Wed, 17 Sep 2008 19:01:03 +0000 (UTC)
Organization: Mitre Corp
Lines: 21
Message-ID: <gark5f$fet$1@fred.mathworks.com>
References: <garivv$sni$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1221678063 15837 172.30.248.37 (17 Sep 2008 19:01:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Sep 2008 19:01:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2318
Xref: news.mathworks.com comp.soft-sys.matlab:490659


"Raju Gain" <supernova5271@yahoo.com> wrote in message <garivv$sni$1@fred.mathworks.com>...
> Hello,
> 
> I have created a variable A = zeros(5,5). The first three columns contain double values. I have another variable which contains strings for example 'Yes' or 'No'. I am trying to add this variable to A(:,4) (to make it as the fourth column) but I keep getting an error which says " The following error occurred converting from cell to double:
> Error using ==> double
> Conversion to double from cell is not possible."
> 
> I am not sure what I am doing wrong. It should be quite straight forward. Can someone help?
> 
> Thanks

% This should get you started:

A = zeros(5,5)
B = num2cell(A)

B{4,1} = 'yes'
B{1,4} = 'no'

% etc.