+ Post New Thread
Results 1 to 6 of 6

5th January 2017, 17:03 #1
 Join Date
 Mar 2016
 Posts
 3
 Helped
 0 / 0
 Points
 175
 Level
 2
Matlab  RCS calculation surf function
Hello,
I am calculating Radar Cross Section with matlab. My results are correct, i want to plot these results.
I have 2 input variables.
I use the "surf" function.
Following RCS values, i want to color the curve. For example, for RCS = 5 to 2, the curve will be yellow, for RCS = 10 to 20, orange, ... I don't know how to do it.
Can you help me ?

5th January 2017, 17:03

5th January 2017, 17:20 #2
 Join Date
 Dec 2015
 Location
 Madrid, Spain
 Posts
 690
 Helped
 167 / 167
 Points
 3,796
 Level
 14
Re: Matlab  RCS calculation surf function
On the Mathworks page I have found the following:
surf(Z,C) plots the height of Z, a singlevalued function defined over a geometrically rectangular grid, and uses matrix C, assumed to be the same size as Z, to color the surface. See Coloring Mesh and Surface Plots for information on defining C.

5th January 2017, 17:20

6th January 2017, 13:58 #3
 Join Date
 Mar 2016
 Posts
 3
 Helped
 0 / 0
 Points
 175
 Level
 2
Re: Matlab  RCS calculation surf function
Thank you for your answer.
I have only values that interest me.
Now i am trying to color the curve in different part.
ex : color 1 : values between 5 and 3
color 2 : values between 3 and 5
color 3 ...
I want to keep the surf function for the curve.

6th January 2017, 13:58

6th January 2017, 14:32 #4
 Join Date
 Dec 2015
 Location
 Madrid, Spain
 Posts
 690
 Helped
 167 / 167
 Points
 3,796
 Level
 14
Re: Matlab  RCS calculation surf function
I do not see the problem.

6th January 2017, 15:11 #5
 Join Date
 Mar 2016
 Posts
 3
 Helped
 0 / 0
 Points
 175
 Level
 2
Re: Matlab  RCS calculation surf function
I use the surf function to display values. I want to assign colors to the curve in function of range of values. I am not sur if i had to use colormap with conditions.

6th January 2017, 15:11

6th January 2017, 17:45 #6
 Join Date
 Dec 2015
 Location
 Madrid, Spain
 Posts
 690
 Helped
 167 / 167
 Points
 3,796
 Level
 14
Re: Matlab  RCS calculation surf function
You can assign the "C" matrix the values you want.
This is a MATLAB script assigning red,green and blue.
Code:clear clc A=ones(25,25);%create a simple matrix with the dimension required (mXn) %Here, start changing the matrix C1 as you wish C1 = zeros(size(A)); % filling First RGB table for row=1:12 for column=1:12 C1(row,column)=1; end end for row=13:17 for column=13:17 C1(row,column)=0; end end for row=18:25 for column=18:25 C1(row,column)=0; end end C2 = zeros(size(A)); % filling Second RGB table for row=1:12 for column=1:12 C2(row,column)=0; end end for row=13:17 for column=13:17 C2(row,column)=1; end end for row=18:25 for column=18:25 C2(row,column)=0; end end C3 = zeros(size(A)); % filling Third RGB table for row=1:12 for column=1:12 C3(row,column)=0; end end for row=13:17 for column=13:17 C3(row,column)=0; end end for row=18:25 for column=18:25 C3(row,column)=1; end end %Define the 3 RGB tables with C1,C2,C3 C(:,:,1)=C1; C(:,:,2)=C2; C(:,:,3)=C3; Z = peaks(25); surf(Z,C) title('EXAMPLE')
You have to assign in each RGB table the value you want.
I have made this:
 rows 0 to 12 and columns 0 to 12 > asign RED which means in table one is 1, in table 2 is 0 and in table 3 is 0
 rows 13 to 17 and columns 13 to 17 > asign GREEN which means in table one is 0, in table 2 is 1 and in table 3 is 0
 rows 18 to 25 and columns 18 to 25 > asign BLUE which means in table one is 0, in table 2 is 0 and in table 3 is 1
So it would be like this:
Color<>Table 1<>Table 2<>Table 3
RED<>1<>0<>0
GREEN<>0<>1<>0
BLUE<>0<>0<>1Last edited by CataM; 6th January 2017 at 17:50.
+ Post New Thread
Please login