matlab菜鸟物流求教

查看: 8210|回复: 2|关注: 0
菜鸟求教~~Matlab关于vertcat错误
代码和错误
G=[1,2;0;2];H=[0,1];U=1;
for k=0:400;
& & X=G*X+H*U;
& & plot(X1(1),X1(2),'o');end
??? Error using ==& vertcat
CAT arguments dimensions are not consistent.
似乎是数组的维度不一样&&不知道怎么改 求教诸位大大了:handshake
G=[1,2;0,2];H=[0;1];U=1;
for k=0:400;
& & X=G*X+H*U;
& & plot(X(1),X(2),'o');
回复 2# rock1353 的帖子
非常感谢!!!
站长推荐 /2
Powered bymatlab编程问题!本人初学菜鸟,求指教!!问题如下, matlab编程问题!本人初学菜鸟
matlab编程问题!本人初学菜鸟,求指教!!问题如下 m文件变了一个function函数;3];u2=u(2);cos(a);u3=u(3);u2=dot_b+dot_c*sin(a)-w0*cos(c)*cos(a), -(sin(b) - 3*cos(b) + (cos(c)*sin(a))/函数的作用是,程序如下;dot_a dot_b dot_c];&dot_a=u(1)*cos(b)+u(3)*sin(b)+w0*sin(c);u3=dot_a*sin(b)+dot_c*cos(a)*cos(b)+w0*(sin(a)*cos(b)*cos(c)-sin(b)*sin(c)):&gt,c;2:function y = fcn(u)%#codegenw0=0,
c][ cos(b) + 3*sin(b) + sin(c)/1000 + 2;cos(a)] 求大神帮忙;&gt,为什么结果是这样而不是具体的数值;& u=[1.001;1000) + (cos(a)*cos(c))/dot_b=u(2)+w0*cos(a)*cos(c)+tan(a)*(u(1)*sin(b)-u(3)*cos(b)+w0*sin(a)*cos(c)):输入一个矩阵u,b。这是运行结果, tan(a)*(sin(b) - 3*cos(b) + (cos(c)*sin(a))/syms dot_a dot_b dot_c a b cu1=dot_a*cos(b)-dot_c*cos(a)*sin(b)-w0*(sin(c)*cos(b)+sin(a)*sin(b)*cos(c));u1=u(1);1000)/dot_c=(-u(1)*sin(b)+u(3)*cos(b)-w0*sin(a)*cos(c))/ fcn(u) ans = [
y = [a;1000,想要求出a b c dot_a dot_b dot_c,
b 14-6-10 matlab编程问题!本人初学菜鸟,求指教!!问题如下
fun函数定义出错不要使用syms直接写出a b c dot_a dot_b dot_c的具体表达式查看: 2730|回复: 6|关注: 0
菜鸟求教二维数组前N项求和
例:A=[1,2,3;4,5,6;7,8,9]
求每一列的前两项和& &得B=[5,7,9]
大神们来帮帮忙啊......谢谢各位大哥大姐了
sum(A(1:2,:))
关注者: 6
A=[1,2,3;4,5,6;7,8,9]
B=sum(A(1:2,:))复制代码
很明显你的意思是前两行求和。
需要前两列的话转置即可。
回复 2# wave1070 的帖子
恩&&,谢谢 大神
回复 3# myisland 的帖子
myisland 发表于
很明显你的意思是前两行求和。
需要前两列的话转置即可。
求前两列和 用
A=[1,2,3;4,5,6;7,8,9]
B=sum(A(:,1:2))
& & 12& & 15
怎么不对呀,为什么呀
关注者: 6
Win无涯 发表于
求前两列和 用
A=[1,2,3;4,5,6;7,8,9]
B=sum(A(:,1:2))
MATLAB是基于“列”存储的语言,如果不特殊声明的话,所有矩阵都认为是一个行向量,每一个元素都是一个列向量。
sum([1,2;3,4])就相当于[sum([1;3]) sum([2;4])
需要求二维矩阵的累加和时,可以用两次sum
sum(sum(Matrix))
也可以先直接将二维阵拼接为一列
sum(Matrix(:))
站长推荐 /2
Powered by用matlab怎么做双对数回归模型,怎么求其中的参数?我是个纯粹的新手,想请教各位高手,用matlab怎么做双对数回归模型,怎么求其中的参数,比如:log(y)=a+b*log(x1)+c*log(x2) 有关X的矩阵知道,_作业帮
拍照搜题,秒出答案
用matlab怎么做双对数回归模型,怎么求其中的参数?我是个纯粹的新手,想请教各位高手,用matlab怎么做双对数回归模型,怎么求其中的参数,比如:log(y)=a+b*log(x1)+c*log(x2) 有关X的矩阵知道,
用matlab怎么做双对数回归模型,怎么求其中的参数?我是个纯粹的新手,想请教各位高手,用matlab怎么做双对数回归模型,怎么求其中的参数,比如:log(y)=a+b*log(x1)+c*log(x2) 有关X的矩阵知道,怎么求式子里的参数a, b, c?谢谢
可是这就是我要问的问题啊,不会做啊,就是x1,x2......是已知矩阵,怎么求a,b ,c....这些参数的值
%要求输入x1,x2,y,均按行向量输入x1u=log(x1);x2u=log(x2);yu=log(y);x0=ones(1,length(x1u));x=[x0',x1u',x2u'];if rank(x)~=3 disp('方程组x的秩应为m+1')endb=pinv(x)*yn=x*b;yy=exp(yn);stem(y,'b')hold onstem(yy,'r')你试试看看还有没有什么问题查看: 493|回复: 4|关注: 0
新手求教~~~MEX -SETUP问题
本帖最后由 豆子 于
13:43 编辑
搭建了一个电机模型,尝试联系做仿真,结果出现如下两个错误,如何解决,请教!!
1、Unable to locate a Visual C/C++, Watcom, Borland, Intel, or LCC compiler. Please define one of the following environment variables: Real-Time Workshop builds with Microsoft Visual C on 64 bit windows require that the compiler be installed. At least one of these environment variables is expected to be set: VS80COMNTOOLS VS90COMNTOOLS Please check your Microsoft Visual C installation and ensure the appropriate environemnt variable is set. set WATCOM=&WatcomPath& set BORLAND=&BorlandPath& or you can run &mex -setup& to configure the location of your compiler or to use LCC compiler shipped with MATLAB.
(看提示好像是定义环境变量,如何解决)
2、Unable to build a standalone executable to simulate the model
in rapid accelerator mode. This could be because the model has blocks that either do not support code generation or generate code only for specific hardware targets. Models with such blocks cannot be simulated in rapid accelerator mode. The rtwbuild error (message and identifier shown below) may identify these blocks. message: Unable to locate a Visual C/C++, Watcom, Borland, Intel, or LCC compiler. Please define one of the following environment variables: Real-Time Workshop builds with Microsoft Visual C on 64 bit windows require that the compiler be installed. At least one of these environment variables is expected to be set: VS80COMNTOOLS VS90COMNTOOLS Please check your Microsoft Visual C installation and ensure the appropriate environemnt variable is set. set WATCOM=&WatcomPath& set BORLAND=&BorlandPath& or you can run &mex -setup& to configure the location of your compiler or to use LCC compiler shipped with MATLAB. identifier: 'RTW:compilerConfig:compilerUnavailable'.
(模型和m文件有问题?关联不起来?如何解决)
关注者: 86
你的仿真是什么模式?提示你需要安装并配置一个C/C++编译器。
一个电机仿真模型。
初学者,错误比较低级,请各位大神见笑了。
配置过程居然没有可选择项,是否安装错误呢?
终于解决了~~~感谢大猫小微!
不过我电脑重新装卸了好多次,主要是.NET Framework 4.5、重点是GRMSDKX_EN_DVD ISO,注意一定要下载X(64位)ISO。最后重新安装MATLAB(没有尝试是否可以不要重新安装,朋友可尝试一下)。
13:38 上传
点击文件名下载附件
885.74 KB, 下载次数: 48
站长推荐 /2
Powered by}

我要回帖

更多关于 w3c菜鸟 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信