Re: How to get vector elements to be interpreted as comma-separated arguments to a function?



"Joel Dedrick":
<SNIP ML basics...

x = {3, 7, 1, 8}
x = {3, ':', 1, 8}
works, but only with the single quotes around the colon
(more on this later)
x = {3, 'end', 1, 8}
fails, with or without single quotes
x = {3, 2:4, 1, 8}
fails, with or without single quotes

of course...
these should read

x={3,7,1,8}; % <- note: size(x) is 1x4
x{[2,end]}
% ans = 7
% ans = 8
x{[1,end:-1:2]}
% ans = 3
% ans = 8
% ans = 1
% ans = 7
% -but-
x{[1,end:-1:2],1}
% ans = 3 <- find out WHY!

us
.



Relevant Pages

  • Re: Simple code worked fine with SQL2005, but now has a problem with SQL2000.
    ... be anal about spaces semi colons and single quotes. ... cnSQL = New ... fails with the error ... "Format of the initialization string does not conform to specification ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: mdb access to names containing ""
    ... Replace' Replaces single quotes with doubled single ... >>Kevin Spencer ... >>Microsoft MVP ... >>> error or fails when names containing ' are processed. ...
    (microsoft.public.frontpage.programming)
  • Re: ismember - getting wrong result
    ... Poor advise! ... It may work here, but fails elsewhere. ... One is better off understanding the limitations of computer systems in representing numbers. ...
    (comp.soft-sys.matlab)
  • Re: Dlookup function criteria w/wo single quotes
    ... Pamphlet is a text field. ... When I use single quotes it works fine but I get into trouble because ... And yes it was the same database in both cases. ... A client site runs the FAILS version ok with MS Access 2003 11.6566.8132, ...
    (microsoft.public.access.modulesdaovba)
  • Re: simple UPDATE not working
    ... UPDATE peter set last='Peter' where id=3 ... fails as well ... Stephen Howe wrote: ... single quotes not double quotes for SQL strings ...
    (microsoft.public.data.ado)