Date: Nov 26, 2012 11:29 AM
Author: Peter Perkins
Subject: Re: Dataset array error using "replacedata" function

Graham, I think you are using a version of MATLAB that is older than 
when that syntax that was added to the replaceData method (R2010a or b I
think). You can do the replacement in two lines, though.

Hope this helps.


On 11/23/2012 4:56 AM, Graham wrote:
> Hi,
> I'm trying to use the function "replacedata" for a dataset array
> (http://www.mathworks.com/help/stats/dataset.replacedata.html). When I
> run the following example code:
>
> data = dataset({rand(3,3),'Var1','Var2','Var3'})
> data = replacedata(data,@zscore)
>
> I get an error:
>
> ??? Error using ==> dataset.replacedata at 35
> X must have the same number of rows as A has observations.
>
> Please help?
>
> Many thanks