matlab出错

时间:2015-11-01 09:43:40

标签: matlab

我在matlab中编写了以下代码,它应该返回向量uexact:

function v=uexact(x,t)
  v=sin(2*pi*x)*exp(-4*pi^2*t);
end

function [ex]=test3

  h = 1/50; 
  T=1/2500; 

  x=0:h:1; 
  t=0:T:1; 



  ex=uexact(x,t);

end

我收到以下警告信息:

??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> uexact at 3
  v=sin(2*pi*x)*exp(-4*pi^2*t);

Error in ==> test3 at 11
  ex=uexact(x,t);

你能说出我的错误吗?

1 个答案:

答案 0 :(得分:1)

问题是您的tx大小不同。然后在您的函数中,您尝试将sin(2*pi*x) 1x51exp(-4*pi^2*t) 1x2501相乘,即v=sin(2*pi*x)'*exp(-4*pi^2*t);。这是尺寸不匹配,如您收到的错误消息中所述。

如果你想让一个矩阵作为解决方案 ErrorDocument 403 /403-forbidden.html <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC] RewriteRule ^(.*)$ - [F,L] RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR] RewriteCond %{QUERY_STRING} boot\.ini [NC,OR] RewriteCond %{QUERY_STRING} tag\= [NC,OR] RewriteCond %{QUERY_STRING} ftp\: [NC,OR] RewriteCond %{QUERY_STRING} http\: [NC,OR] RewriteCond %{QUERY_STRING} https\: [NC,OR] RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR] RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR] RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>|ê|"|;|\?|\*|=$).* [NC,OR] RewriteCond %{QUERY_STRING} ^.*(&#x22;|&#x27;|&#x3C;|&#x3E;|&#x5C;|&#x7B;|&#x7C;).* [NC,OR] RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR] RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F|127\.0).* [NC,OR] RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR] RewriteCond %{QUERY_STRING} ^.*(request|select|insert|union|declare).* [NC] RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$ RewriteRule ^(.*)$ - [F,L] </IfModule> Options +FollowSymLinks RewriteEngine On RewriteCond %{ENV:HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)/$ /$1 [R=301,L] RewriteCond %{HTTP_USER_AGENT} AppEngine-Google [NC] RewriteRule .* - [F] RewriteEngine On RewriteCond %{HTTP_USER_AGENT} AppEngine-Google [NC] RewriteRule .* http://zone-series.net [L,R=301] RewriteCond %{HTTP_REFERER} http://jasmeet-js.appspot.com/ RewriteCond %{HTTP_USER_AGENT} AppEngine-Google\s~jasmeet-js RewriteRule .? /403-forbidden.html [L] RewriteEngine On RewriteCond %{HTTP_USER_AGENT} AppEngine-Google [NC] RewriteRule .* - [F] RewriteEngine on RewriteCond %{HTTP_REFERER} appspot.com [NC] RewriteRule .* - [F] RewriteCond %{HTTP_USER_AGENT} ^Baiduspider [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Sogou RewriteRule ^.*$ - [F] BrowserMatchNoCase AppEngine-Google bad_bot Order Deny,Allow Deny from env=bad_bot <Files 403-forbidden.html> order allow,deny allow from all </Files> 就可以了。