How to scatter plot when the values are i.e 1,1 and 1,10 grid
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ihaveaquest
el 22 de Ag. de 2022
Comentada: Ihaveaquest
el 22 de Ag. de 2022
trying to avoid repeating code
plot(sparams.frequency_GHz(1),delta(:,1))
plot(sparams.frequency_GHz(41),delta(:,1))
and for this when i try doing the same it does not work , possible to combine ??
plot(sparams.frequency_GHz(:,1),delta(:,2:end), plot_color,'HandleVisibility','off')
2 comentarios
Kevin Holly
el 22 de Ag. de 2022
Is sparams a table or struct array? How many rows and columns are there for frequency_GHz data? rows and columns for delta?
Respuesta aceptada
Kevin Holly
el 22 de Ag. de 2022
Editada: Kevin Holly
el 22 de Ag. de 2022
What do you want on your y and x axes?
sparams.frequency_GHz = 10*rand(41,16);
delta = rand(41,16);
This one separates the data based on the columns (16 groups)
scatter(sparams.frequency_GHz,delta,'filled')
xlabel('Frequency (GHz')
ylabel('Delta')
This one separates the data based on the rows (41 groups)
scatter(sparams.frequency_GHz',delta','filled')
xlabel('Frequency (GHz')
ylabel('Delta')
3 comentarios
Kevin Holly
el 22 de Ag. de 2022
Editada: Kevin Holly
el 22 de Ag. de 2022
Are you saying there are 10 possible frequency values in the 41x16 matrix?
sparams.frequency_GHz = randi(10,41,16);
sparams.frequency_GHz
delta = rand(41,16);
Create logical array when freq equals 1 or 10.
At_one = sparams.frequency_GHz==1;
At_ten = sparams.frequency_GHz==10;
At_one_ten = logical(At_one + At_ten)
scatter(sparams.frequency_GHz(At_one_ten),delta(At_one_ten),'filled')
xlabel('Frequency (GHz')
ylabel('Delta')
Más respuestas (0)
Ver también
Categorías
Más información sobre Line 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!