[Scilab-users] Converting string months to month numbers
Samuel Gougeon
sgougeon at free.fr
Fri Oct 21 19:17:48 CEST 2016
Hello,
Le 20/10/2016 13:31, Mike Page a écrit :
> Hi Jens,
>
> grep does something like what you want.
>
> -->[r,w]=grep(Ms,M);
> -->matrix(w,size(Ms))
> ans =
>
> 12. 4.
> 2. 12.
> 6. 7.
>
> Not sure why grep produces a vector when searching for a matrix, but
> it seems that way.
.
Because in the general case, there may be no match between Ms and M
components. In that case, r is shorter than Ms, and matrix() can't be used.
BR
More information about the users
mailing list