爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 7608|回复: 7

matlab

[复制链接]

新浪微博达人勋

发表于 2017-6-22 15:55:14 | 显示全部楼层 |阅读模式
1金钱
?? Error: File: C:\Documents and Settings\Administrator\桌面\新建文件夹 (2)\Untitled.m Line: 15 Column: 12
The expression to the left of the equals sign is not a valid target for an assignment.

MATLAB中出现这句话?不知道怎么回事?求解决。

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2017-6-22 20:06:20 | 显示全部楼层
怎么没人呢
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

发表于 2017-6-22 21:33:10 | 显示全部楼层
赋值出错了
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 成长值: 32430
发表于 2017-6-23 07:26:40 | 显示全部楼层
就贴一句错误?程序呢?敢不敢多给一点信息?到底想不想解决问题?
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2017-6-23 09:25:22 | 显示全部楼层
二爷名声在外 发表于 2017-6-23 07:26
就贴一句错误?程序呢?敢不敢多给一点信息?到底想不想解决问题?

%-----------------------------------------------
%Data explanation:
%Data for all over the world:73*144;
%No year and level request;
%Data for monthly mean from NCEP/NCAR;
%Data format:.nc;
%Put your data file in folder ..\data\.
%-------EOF for model 1-------------------------
clear all;close all;clc
f=netcdf('C:\Documents and Settings\All Users\桌面','nowrite');%You can change the data file if you wish.
lon=f{'lon'}(:);
lat=f{'lat'}(:);
%level=f{'level'}(:);
PP=f{'air'}(:);%If you change the data file, you should change the value('uwnd') too.
close(f);
clear f;
%-------You can choose the area and year!------
lon1=70;%longitude of the west boundry.
lon2=140;%longitude of the east boundry.
lat1=0;%latitude of the south boundry.
lat2=60;%latitude of the north boundry.
year1=1979;%year begin.
year2=2007;%year end.
levelnumber=1;%No.'N' level;From the lowest;
%-------------------------------
lonw=lon1/2.5+1;
lone=lon2/2.5+1;
lats=(90-lat1)/2.5+1;
latn=(90-lat2)/2.5+1;
clear lon1 lon2 lat1 lat2;
%--------------------------------
y=[ ];
for m=1:12:(year2-year1+1)*12;
    x=[ ];
    for n=lonw:1:lone;
        %a=(squeeze(PP(m,levelnumber,[latn:lats],n)));
        a=(squeeze(PP(m,[latn:lats],n)))';
        x=[x;a];
    end   
    y=[y,x];
    clear x;
end
clear m n;
clear PP;
clear a;
%y=0.00999999977648258*y+202.649993896484;
z=y*y';
[V,D]=eig(z);
clear z;
r=[ ];
rr=size(D);
for l=1:1:rr;
    r=[r,D(l,l)];
end
clear l D;
%----------Mode----------------------
figure(1)
[m,i]=max(r);
A=V(:,i);
clear i;%maxmum number position.
G=m/(r*ones(rr,1))% accumulation variance
clear m;%maximum number.
AA=[ ];
for n=1:(lats-latn+1):rr;
    AA=[AA,A([n:n+lats-latn],1)];
end
%clear A;
clear n rr;
[C,H]=contourf(lon([lonw:lone],1),lat([latn:lats],1),AA);
clabel(C,H,'LabelSpacing',72,'Rotation',0,'FontSize',8);
clear C H;
grid on;
xlabel('longitude');ylabel('latitude');
%caxis([-0.6,0.6]);
colorbar;
clear lone lonw lats latn;
%-----------Time serial---------------------
figure(2)
Y=V'*y;
clear y;
YY=Y(1,[1:(year2-year1+1)]);
X=year1:1:year2;
hold on;
plot(X,YY);
clear YY;
Z=zeros(1,(year2-year1+1));
plot(X,Z,'r');
axis tight;
xlabel('year');
clear X Z year1 year2;
hold off;
%-----------------------------------
clear A AA V Y lat level levelnumber lon r;

上面是所有程序,希望帮我解决一下,非常感谢
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2017-6-23 09:26:28 | 显示全部楼层

我对这个一点也不懂,怎么解决呢?
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 成长值: 32430
发表于 2017-6-23 11:19:17 | 显示全部楼层
bym 发表于 2017-6-23 09:25
%-----------------------------------------------
%Data explanation:
%Data for all over the wor ...

截图好吗?你这样我怎么知道哪一行!!!
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

新浪微博达人勋

 楼主| 发表于 2017-6-23 12:33:44 | 显示全部楼层
bym 发表于 2017-6-23 09:25
%-----------------------------------------------
%Data explanation:
%Data for all over the wor ...

应该是这里出问题了!

命令窗口下面显示的是:
?? Error: File: C:\Documents and Settings\Administrator\桌面\新建文件夹 (2)\Untitled.m Line: 15 Column: 12
The expression to the left of the equals sign is not a valid target for an assignment.

JQ2TZ(Q6OZ6CMWCYFYTO}]9.png
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表