声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3479|回复: 1

[综合讨论] 这个错误提示:Error evaluating parameter 'Value' in。。。

[复制链接]
发表于 2010-4-8 23:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x

错误提示就是这个,我也找到解决方案“
问题描述:the most common problem with using script files is that MATLAB cannot locate the script file you wish to execute. This errorcan be very frustrating to inexperienced MATLAB users because MATLAB gives the error message:        ??? Undefined function or variable ...
解决方案:
and it is not immediately clear why the function is undefined when its m-file is clearly visible to the user.
The solution to this is to make sure that MATLAB's internal path variable is set to the direction containing the script.
我是在根目录A直接建立函数a,其中a函数里面有调用函数b是在A的子目录C,函数b又调用赋值脚本文件c在A的子目录B里面。
然后执行过程中就发现就发现赋值部分没有被执行!
算不算他说的‘ that MATLAB's internal path variable is set to the direction containing the script’.按说我这些都是在根目录A建立的文件呀,
更加有趣的是我如果先单步运行一下,所有的值都赋值成功,下一次就可以正常运行,但是如果不执行单步,就会出现以上提示~好奇怪

回复
分享到:

使用道具 举报

 楼主| 发表于 2010-4-12 17:01 | 显示全部楼层
自问自答:是由不同的workspace引起的错误,所调用m function都有各自的workspace,但是调用的simulink模型所用赋值只能够来自base workspace,就是我们平时看到的那个,所有即使在m function里面赋值成功,也是只在刺function的workspace,并不算给模型赋值成功。
我做单步运行时候成功是一个愚蠢的巧合,当时调试不出来把老程序运行了一遍(那个赋值都赋在base workspace了),结果再运行这个就给成功了~
大家引以为戒,也欢迎拍砖!

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-15 01:10 , Processed in 0.053058 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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