Matlab使用技巧

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Matlab-scope示波器菜单调用命令set(0,'ShowHiddenHandles','on');

set(gcf,'menubar','figure');

一般的测量检测模块是把示波器输入端连到要测量的参数所在点或者回路。Multimeter则不一样。

楼主有没有注意过有的模块的连接是尖头的,有的是一个圆圈形状的?可以理解为尖头的是弱电或数字信号,可以用示波器直接测。圆头的是强电信号,不能直接用示波器。

对于这样的信号,一般是:有些器件(强电器件)打开后,器件设置单中最后有一栏是“测量量”,选择测量什么信号以后,再用Multimeter“不接触测量”。

比如:一个RLC模块,最后一栏选定“测量所有电流电压”。注意这之前Multimeter打开左栏是空白的,外观是一个“回”里面一个“0”,选定RLC“测量所有电流电压”后打开Multimeter,左栏就有RLC的电流电压什么的了。选定要测的,移到右栏,就可以用示波器测波形了。此后“回”里面就不是“0”了,而是用户选择测量的数据个数了。

matlab 6.5/7.0——simulink模型无法保存及其兼容性问题完整解决方案

2009-06-25 09:45

mdl文件在6.5里面做的,但是到了7.0里面却打不开,下面就是相关信息:

Warning: Unable to load model file 'd:\MATLAB7\work\*.mdl'. Run "bdclose all; set_param(0, 'CharacterEncoding', Enc)" where Enc is one of windows-1252, ISO-8859-1, then load the model. The first character that is not supported in the current character encoding setting

('ibm-1386_P100-2002') occurs on line 1795, byte offset 21. To correctly load models with non-ASCII characters, you must explicitly use the character encoding that was used to save the file. Type "help slCharacterEncoding" for more information on setting character encoding and to learn more about which encodings are commonly found on your platform.

或者是直接保存出现如下信息:

Error while saving model 'untitled'using the character encoding setting 'ibm.....

问题产生原因:模型中含有不能识别的字符,比如中文等等,尤其是matlab对中文的支持不是很好(不知道是不是D版的原因)。解决的办法:

(1)在工作空间中输入下列命令,然后打开

bdclose all;

set_param(0,'CharacterEncoding','windows-1252')

或(2)在工作空间中输入下列命令,然后打开

bdclose all

set_param(0, 'CharacterEncoding', 'ISO-8859-1')

或(3)在工作空间中输入下列命令,然后打开

bdclose all

slCharacterEncoding('iso-8859-1')

然后即可保存*.mdl,然后用写字板或记事本打开模型文件*.mdl,发现内部原来是有汉字不能识别,将其改为英文,存盘退出即可。(大部分原因是因为你的计算机名和用户名是中文导致的(将其改为英文——右击我的电脑——属性对话框的计算机名面板——修改完毕,重启计算机即可))

同样如果要在7.0的模型里用中文注释,然后保存,就需要

set_param('ModelName', 'SavedCharacterEncoding', 'ISO-8859-1')

这里ModelName是你的mdl模型名,而且必须被打开了。

注:可能出现问题的参数是“LastModifiedBy”,这是最后修改模型人的名字;假如你的机子装系统的时候个人名字和单位填的是中文的话就要注意了,你装matlab时默认得也是这个中文名字,如果不改的话就会出现这个问题了。所以大家尽量用英文(包括S-function的注释),以避免不必要的麻烦!

几点建议:

(1)建议大家都统一用matlab7.0版本的,一些7.0.1等等如无必要,就不要装了。顺便说一下,有人说装了matlab7.0以后,系统进程里有一个Matlab Server.exe,占用内存很大,去掉的方法就是在管理工具->服务中将的启动类型由“自动”改为”禁止“就可以了。

(2)尽量避免用中文!

1)装matlab的时候,注意你的用户及单位一定要用英文或数字,不要用中文;2)自己封装的模块名字不要用中文,模型中的注释也要用英文;

Matlab、Simulink出错处理

2008-11-17 21:16

出错信息:

Warning: Unable to load model file

'D:\MATLAB701\work\pid_steering_threshold_braking.mdl'. Run "bdclose all; set_param(0, 'CharacterEncoding', Enc)" where Enc is one of windows-1252, ISO-8859-1, then load the model. The first character that is not supported in the current character encoding setting

('ibm-1386_P100-2002') occurs on line 403, byte offset 23. To correctly load models with non-ASCII characters, you must explicitly use the character encoding that was used to save the file. Type "help slCharacterEncoding" for more information on setting character encoding and to learn more about which encodings are commonly found on your platform.

帮助信息:

help slCharacterEncoding

SLCHARACTERENCODING: Change the MATLAB character encoding setting.

If you have a model containing non-ASCII characters, you need to change the

MATLAB character set encoding to be compatible with these characters before

loading the model. Currently, MATLAB supports: 'US-ASCII',

'Shift_JIS',

'ISO-8859-1', 'IBM-5348_P100-1997', 'cp1252'.

You need to close all open models and libraries before changing the MATLAB character set encoding except when changing from 'US-ASCII' to

another encoding.

Common character encoding settings by platform:

Unix, Linux, Mac : 'US-ASCII', 'Shift_JIS'

Hp-UX : 'ibm-1051_P100-1995'

Windows (USA, Western Europe): 'IBM-5348_P100-1997', 'cp1252' Windows (Japan) : 'Shift_JIS'

Windows (Other) : 'ISO-8859-1'

Any setting can be used on any platform. For maximum portability across

platforms and locales, it is recommended that you set the default

相关文档
最新文档