how to compare array with matlab

前端 未结 2 1037
生来不讨喜
生来不讨喜 2021-01-24 16:20

I would like to comapre two arrays of strings how could I affect the following values to a,b,c,d , when I try as below, I go

2条回答
  •  不要未来只要你来
    2021-01-24 17:11

    Following on from Li-aung's answer, what you probably want is something like

    isequal({a,b,c,d}, {'a', '0', '10', '20'})
    

    This will return true iff a has the value 'a' and so on.

    EDIT

    To perform multiple assignments, you can use DEAL

    [a,b,c,d] = deal('a', '0', '10', '20')
    

提交回复
热议问题