Borrar filtros
Borrar filtros

For the following plots, colormap I have tried does not seem to be working.

6 visualizaciones (últimos 30 días)
KM
KM el 26 de Mayo de 2023
Editada: KM el 7 de Jun. de 2023

Hello,
I am trying to make a vector field plot using arrow3D. Here, I want the colormap on arrow to change with the variation in z-axis more like aplot of a magnetic skyrmion field. But the cmap is not wokring.
kindly don't post the entire code. A snippet of code for the understanding would be a great help!

Thanks.

  5 comentarios
Image Analyst
Image Analyst el 26 de Mayo de 2023
Reconcile "colormap I have tried does seem to be working" with "the cmap is not wokring". Is it working or not, or sometimes working and sometimes not working?
KM
KM el 27 de Mayo de 2023
Editada: KM el 27 de Mayo de 2023
V sorry. There was a typo in the caption. colormap I have tried does not* seem to be working.
Although I use an older version of MATLAB but did run it on MATLAB online with the latest version available. It is not working there as well.

Iniciar sesión para comentar.

Respuestas (1)

Adam Danz
Adam Danz el 26 de Mayo de 2023
Movida: Adam Danz el 26 de Mayo de 2023
The question is about cmap but cmap doesn't exist in you code so I assume cmap is a variable (or function) in arrow3D but I don't know what arrow3D is so how is it possible to address the issue?
You're right that MATLAB's quiver3 does not support colormap mapping. You could plot each quiver arrow individually in which case each arrow could have its own color but depending on the number of arrows, this could make take up a lot of memory since you're creating many quiver objects that way. That method is demonstrated in the two answers below (in 2D).
Maybe there's a 3D demo in the forum, I haven't checked.
  10 comentarios
Adam Danz
Adam Danz el 1 de Jun. de 2023
Editada: Adam Danz el 1 de Jun. de 2023
Here's an annology,
Why is the ouput (z) 5?
x = 1;
y = 2;
z = myFunction(x,y);
z =
5
KM
KM el 3 de Jun. de 2023
Editada: KM el 7 de Jun. de 2023
@Adam Danz That's because you have not installed file exchange arrow3D package* (updated the link). https://in.mathworks.com/matlabcentral/fileexchange/12274-3d-arrow-with-many-color-parameter-options?s_tid=srchtitle
Attached is my plot. I have also attatched the package files here in case you want to run with arrow3D.

Iniciar sesión para comentar.

Categorías

Más información sobre Purple 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!

Translated by