Surface Plot using determinants under meshgrid command.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi! I have to plot a surface plot in which determinants and ratio of determinants is involved. But it gives some errors. I'm attaching script file. Plz resolve the problems in it. I will be thankful to you.
0 comentarios
Respuestas (1)
Walter Roberson
el 7 de Mayo de 2020
[a.*F b.*G c.*H 0
F and G and H are 201 x 201, so the part before the 0 is fine.
However, when you code a 0 as part of a [] list, then MATLAB does not automatically expand the 0 to have the same number of rows (or columns) as might be implied by the context. You need to do something like
rz = zeros(size(F,1));
ro = ones(size(F,1));
A=([a.*F b.*G c.*H rz;(a^2).*J (b^2).*K (c^2).*L rz;(a^3).*J (b^3).*K (c^3).*L ro;(a^4).*F (b^4).*G (c^4).*H rz]);
This would create A as being (4*201) x (201*3+1)
This will, of course, fail when you det(). Which suggests that where you coded the 0 and 1 scalars, what you really wanted as a 201 x 201 block of 0 or 1. If so then
rz = zeros(size(F));
ro = ones(size(F));
3 comentarios
Walter Roberson
el 7 de Mayo de 2020
Sure, which is what they should be for those matrices. Everything you are taking det() of is singular, determinant 0.
Your individual matrices, d1, d2, d3, have rank 2, as do F, G, J, K, L. Your A, B matrices are each rank 7, your C, D are each rank 6.
When you meshgrid, one of the two matrices has every row the same as the other (which is rank 1), and the other matrix has every column the same as each other (which is also rank 1). Going in the other direction, there are constant (to within round off) differences between rows (or columns) . That makes the columns or rows linear combinations of (first column) and (second column minus first column), so that is rank 2.
At the moment I am not sure why adding in the exp() still gives you the same rank. I do notice that if you switch the calculations to symbolic then some of the matrices become full rank... but double() of thoe matrices collapse back to rank 2, as also happens to vpa() of the matrix.
Ver también
Categorías
Más información sobre Surface and Mesh Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!