Jet function output error

1 Ansicht (letzte 30 Tage)
WizKing
WizKing am 29 Jul. 2018
Kommentiert: Walter Roberson am 4 Aug. 2018
I got a script that is to create a flux map using two images; image of reflected rays and image of the sun. The inital lines make sense and produce an output but the total result is null (the is no flux map) after running it. I realized the
jet (ceil (max(fmap_img(:)))
did not produce anything. Any help?
  4 Kommentare
Walter Roberson
Walter Roberson am 29 Jul. 2018
You can attach the script.
WizKing
WizKing am 30 Jul. 2018
@Walter Robertson. Okay

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 30 Jul. 2018
Bearbeitet: Image Analyst am 30 Jul. 2018
You must pass Jet an integer that is the number of colors it is supposed to create.
Try this:
numberOfColors = ceil (max(fmap_img(:))) % No semicolon
cmap = jet(numberOfColors) % Create a color map.
colormap(cmap); % Apply the colormap to the indexed/gray scale image.
What do you see in the command window? Does the image look pseudocolored now?
You might also want to look into caxis().
  6 Kommentare
WizKing
WizKing am 3 Aug. 2018
Bearbeitet: Walter Roberson am 4 Aug. 2018
Okay please I have done that.
Also, after the colormap() call. I want to create a surface that looks like:
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
% surface in 3D
figure;
surf(Z,'EdgeColor','None'); view(2)% surface in 2D
Using the colormap() output in the script. So that the red will be the centre color (peak), followed by yellow up to blue in a concentric circular transition.
Walter Roberson
Walter Roberson am 4 Aug. 2018
colormap(jet)
after the above code would produce that effect.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Orange finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by