Error: Missing variable or function.

matlab中出现:Missing variable or function_百度知道
matlab中出现:Missing variable or function
903 0:1.500 0,’0’)
|Error,z)hold onendplot(a;(a(i+2)-a(i+1)).300 0:10clear a_clear za_=a(i),’0’)hold ont=0.00],b;b=[0.0 0:0;for i=1.914 0.789 0;(a(i+2)-a(i))*(a_(j)-a(i+1))/endplot(a_.212 0,b;(a(i+1)-a(i))*(a_(j)-a(i+2))&#47.397 0.957 0.618 0.200 0?.853 0;for j=1,n]=size(a_).592 0;(a(i)-a(i+1))*(a_(j)-a(i+2))&#47:nz(j)=b(i)*(a_(j)-a(i+1))&#47.00]cleara=[0.370 0? plot(a.489 0.0 0;(a(i+1)-a(i+2))+b(i+2)*(a_(j)-a(i))&#47.710 0.700 0?.950 1.088 0,t).001;(a(i)-a(i+2))+b(i+1)*(a_(j)-a(i))/plot(t.803 0;[m:a(i+2).979 1: Missing variable or function
提问者采纳
’0’)中的0改成o./zhidao/pic/item/242dd42a2834349bfd8e0ffecbea15ce37d3bec5把plot(a,b.baidu。我在matlab2013b下正确执行没有任何错误.hiphotos:///zhidao/wh%3D600%2C800/sign=/zhidao/wh%3D450%2C600/sign=d340b4b59b25bc312b08099c6befa187/242dd42a2834349bfd8e0ffecbea15ce37d3bec5://g://g.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="http.hiphotos.jpg" esrc="http:<a href="http
前面都一样endplot(a,b,’o’)hold ont=0:1;plot(t,t)??? plot(a,b,’o’)
|Error: Missing variable or function.亲!你好!还是不行?请问咋回事?
你是把整段代码放在一个m文件里运行的吗?
是啊!在一个command window里面运行的!
不是……是要新建一个m文件,把这些内容复制进去,然后运行。
& 亲!你好!还是不行!我是个新手!整个程序那部分在m文件中,那部分在command window中!你看看我的问题在哪?最好能截屏看看!
这叫在m文件中 明白么?
提问者评价
亲!非常感谢你!
其他类似问题
matlab的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁谁知道matlab中的问题Missing variable or function?
clear allX= [ 41 ,78 ,55 ,78 ,60 ,61 ,71 ,85 ,85 ; 95 ,91 ,79 ,86 ,99 , 92 , 98 , 85 , 85 ; 81 , 85 , 83 , 84 , 93 , 92 ,91 ,95 ,85 ; 67 ,76 ,42 ,76 ,44 ,75 ,84 ,85 ,85 ;66 ,73 , 60 , 79 , 70 , 64 , 85 , 85 , 85 ; 87 , 86 , 74 ,86 ,93 ,91 ,81 ,85 ,90 ; 75 ,84 ,69 ,81 ,78 ,86 ,85 ,85 , 85 ; 97 , 92 , 84 , 81 , 85 , 92 , 99 , 95 , 75 ;89 ,73 ,56 ,79 ,82 ,89 ,84 ,85 ,85 ; 93 ,82 ,64 ,90 ,95 ,92 ,95 ,85 ,75 ] ;I = ones (10 ,10) ;for i = 1 :10 &#160;for j=1:9Y(i ,j) = (abs (X(i ,1) - X(j ,1) ) + abs (X(i ,2) - X(j ,2) ) + abs (X(i ,3) - X(j ,3) ) + abs (X(i ,4) - X(j ,4) ) + abs (X(i ,5) - X(j ,5) ) + abs (X(i ,6) - X(j ,6) ) + abs (X(i ,7) - X(j ,7) ) + abs (X(i ,8) - X(j ,8) ) + abs (X(i ,9) - X(j ,9) ) ) ;end 出现??? &#160; for j=1:10 &#160; &#160;|Error: Missing variable or function.&& flag = 0 ;E = R ;while flag = = 0 for i = 1 :10 &#160;for j = 1 :10 &#160; for k = 1 :10 &#160; &#160;minmax(k) = max(min(E(i ,k) ,E(k ,j) ) ) ; &#160; end B(i ,j) = max (minmax) ; &#160; end &#160;end if B = = E flag = 1 ; else &#160;E =B ;endend& & B??? Undefined function or variable &#39;R&#39;.还有
09-07-16 & 发布
第一个问题 最后缺少一个end 添加之后就OK第二个问题 R 在使用之前没有定义,请先定义具体值,然后再使用!
请登录后再发表评论!
FUNCTION Add new function. New functions may be added to MATLAB&#39;s vocabulary if they are expressed in terms of other existing functions. The commands and functions that comprise the new function must be put in a file whose name defines the name of the new function, with a filename extension of &#39;.m&#39;. At the top of the file must be a line that contains the syntax definition for the new function. For example, the existence of a file on disk called STAT.M with: function [mean,stdev] = stat(x) %STAT Interesting statistics. n = length(x); mean = sum(x) / stdev = sqrt(sum((x - mean).^2)/n); defines a new function called STAT that calculates the mean and standard deviation of a vector. The variables within the body of the function are all local variables. See SCRIPT for procedures that work globally on the work- space. A subfunction that is visible to the other functions in the same file is created by defining a new function with the FUNCTION keyword after the body of the preceding function or subfunction. For example, avg is a subfunction within the file STAT.M: function [mean,stdev] = stat(x) %STAT Interesting statistics. n = length(x); mean = avg(x,n); stdev = sqrt(sum((x-avg(x,n)).^2)/n); %------------------------- function mean = avg(x,n) %MEAN subfunction mean = sum(x)/n; Subfunctions are not visible outside the file where they are defined. Normally functions return when the end of the function is reached. A RETURN statement can be used to force an early return.
请登录后再发表评论!

我要回帖

更多关于 matlab 的文章

 

随机推荐