Effacer les filtres
Effacer les filtres

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 0-by-1.

2 vues (au cours des 30 derniers jours)
There is a lot of questions here on the community but no one answer porperly my question.
Here is the code:
load('data.mat')
v=0.90:0.01:1.05;
ca=0.95:0.01:1.05;
for i=1:length(v)
for j=1:length(ca)
ij=find(data(:,1)==v(i) & data(:,2)==ca(j));
M(i,j)=data(ij,3);
end
end
[V,CA]=meshgrid(v,ca);
contourf(V,CA,M,20);
Hope you can help me. I attached the data file.

Réponse acceptée

KSSV
KSSV le 21 Mai 2020
You want this.
S = load("data.mat") ;
data = S.Fe2MnGe_new ;
v = data(:,1) ;
ca = data(:,2) ;
z = data(:,3) ;
nx = length(unique(v)) ; ny = length(unique(ca)) ;
X = reshape(v,ny,nx) ;
Y = reshape(ca,ny,nx) ;
Z = reshape(z,ny,nx) ;
contour(X,Y,Z)

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by