how to create a matrix when using surf function？
3 views (last 30 days)
I want to solve this problem：
however, in this way, matlab tells me ''
错误使用 surf (line 71)
how can I use surf correctly?
_ on 18 Jan 2022
What you are doing there is making F a scalar, but F needs to be a matrix the same size as u and v, so something like this:
F = ones(size(u));
F(D1 <= 40 & D2 <= 40) = 0;
Here logical indexing is used to set the value of F based on conditions involving D1 and D2.