你编程时应该注意的两个问题:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1. bo'(x,y)这种你认为的转置, 应该是计算机和我们都不能理解的;
2. 不应该出现cos(a), B(x)等等之类的貌似正确,却是语法错误的写法.
要求某一点函数值可用subs(Bx,x,0)的形式来求取.
另:已经强调过了,你的kb没有定义.如果是变量,可以用syms kb.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%针对你的上述代码,可修改如下:
%%%%%%%%%%%%%%%%%%%
syms kb x
i=sqrt(-1);
s=1:4;
structure=exp(-i.^s*kb*x);
Ass=[];
x1=0;
A1=subs(structure,x,x1);
x2=1.5;
A2=subs(structure,x,x2);
Bx=diff(structure,x);%结构波函数对x求导
A3=subs(Bx,x,0);
A4=subs(Bx,x,1.5);
Ass=[A1;A2;A3;A4]
%%%%%%%%%%%%%%%%%%%%%%% |