Question about representation of data in Matlab

In summary, the conversation discusses the use of the quiver command to plot a matrix of sea surface temperature correlations with another variable. The matrix is of size (360x180x12) and the speaker wants to plot another matrix of the same size that only contains significant data. However, there is an error when using the quiver command due to the need for all four variables to have the same size. The speaker is seeking advice on how to properly use quiver or alternative suggestions.
  • #1
Frank Einstein
170
1
Hi everybody; I have plotted a matrix with sea surface temperature's correlation with another variable, the size is (360x180x12); using to plot :

figure
for i=1:12
subplot(4,3,i);imagescnan(loni,lati,squeeze(double(r4_sat(:,:,i)))'),colorbar;
end


Now, I want to plot over it another matrix of the same size which contains the same data but only when it is significative; I think the comand quiver would be suitable for this, but when I try to use it, there is an error.

figure
for i=1:12
subplot(4,3,i);imagescnan(loni,lati,squeeze(double(r4_sat(:,:,i)))'),colorbar;
hold on
subplot(4,3,i); quiver(loni,lati, r4_sat_sign(:,:,i), r4_sat_sign(:,:,i));
end

The error comes from the fact that I need to have the same size for all four variables, but I don't know how to manage it.

Can someone please tell me how to properly use quiver here or sugest an alternative?
Thanks for reading.
 
Physics news on Phys.org

FAQ: Question about representation of data in Matlab

1. How do I import data into Matlab for analysis?

To import data into Matlab, you can use the importdata function. This function supports various file formats such as text files, spreadsheets, and image files. You can also use the readtable function for importing data from spreadsheets.

2. How do I create plots and graphs to represent my data in Matlab?

Matlab has a built-in function called plot that allows you to create various types of plots and graphs, such as line plots, scatter plots, and bar graphs. You can also customize your plots by adding labels, titles, and legends.

3. Can I export my data and plots from Matlab to other software?

Yes, Matlab allows you to export your data and plots to other software such as Microsoft Excel and image editing programs. You can use the xlswrite function to export data to Excel and the saveas function to export plots as image files.

4. How can I perform statistical analysis on my data in Matlab?

Matlab has a Statistics and Machine Learning Toolbox that provides functions for various statistical analysis tasks, such as calculating descriptive statistics, performing hypothesis tests, and fitting regression models. You can also use the mean, median, and std functions for basic statistical calculations.

5. Is there a way to automate the process of analyzing and representing data in Matlab?

Yes, Matlab has a scripting language called m-file that allows you to write scripts to automate your data analysis and visualization tasks. You can also use the publish function to create reports that include your code, results, and visualizations.

Similar threads

Replies
8
Views
742
Replies
5
Views
883
Replies
12
Views
3K
Replies
8
Views
1K
Replies
1
Views
2K
Replies
1
Views
2K
Back
Top