下面是GUI的程序,

在c的地方设置的是可见光的波长,但是lamda_slider不能进行控制,默认波长600e-9,运行后只有c = [0 0 0;1 0 0]

求解

function varargout = untitled(varargin)

%UNTITLED M-file for untitled.fig

%      UNTITLED, by itself, creates a new UNTITLED or raises the existing

%      singleton*.

%

%      H = UNTITLED returns the handle to a new UNTITLED or the handle to

%      the existing singleton*.

%

%      UNTITLED('Property','Value',...) creates a new UNTITLED using the

%      given property value pairs. Unrecognized properties are passed via

%      varargin to untitled_OpeningFcn.  This calling syntax produces a

%      warning when there is an existing singleton*.

%

%      UNTITLED('CALLBACK') and UNTITLED('CALLBACK',hObject,...) call the

%      local function named CALLBACK in UNTITLED.M with the given input

%      arguments.

%

%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one

%      instance to run (singleton)".

%

% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help untitled

% Last Modified by GUIDE v2.5 13-Aug-2008 15:51:13

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name',       mfilename, ...

'gui_Singleton',  gui_Singleton, ...

'gui_OpeningFcn', @untitled_OpeningFcn, ...

'gui_OutputFcn',  @untitled_OutputFcn, ...

'gui_LayoutFcn',  [], ...

'gui_Callback',   []);

if nargin && ischar(varargin{1})

gui_State.gui_Callback = str2func(varargin{1});

end

if nargout

[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});

else

gui_mainfcn(gui_State, varargin{:});

end

% End initialization code - DO NOT EDIT

% --- Executes just before untitled is made visible.

function untitled_OpeningFcn(hObject, eventdata, handles, varargin)

% This function has no output args, see OutputFcn.

% hObject    handle to figure

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

% varargin   unrecognized PropertyName/PropertyValue pairs from the

%            command line (see VARARGIN)

% Choose default command line output for untitled

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

% UIWAIT makes untitled wait for user response (see UIRESUME)

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = untitled_OutputFcn(hObject, eventdata, handles)

% varargout  cell array for returning output args (see VARARGOUT);

% hObject    handle to figure

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure

varargout{1} = handles.output;

% --- Executes on slider movement.

function lamda_slider_Callback(hObject, eventdata, handles)

% hObject    handle to lamda_slider (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider

%        get(hObject,'Min') and get(hObject,'Max') to determine range of

%        slider

get(handles.lamda_slider,'Max');

get(handles.lamda_slider,'Value');

get(handles.lamda_slider,'Min');

% --- Executes during object creation, after setting all properties.

function lamda_slider_CreateFcn(hObject, eventdata, handles)

% hObject    handle to lamda_slider (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    empty - handles not created until after all CreateFcns called

set(hObject,'Max',760e-9);

set(hObject,'Value',600e-9);

set(hObject,'Min',390e-9);

% Hint: slider controls usually have a light gray background.

if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor',[.9 .9 .9]);

end

% --- Executes on button press in start_pushbutton.

function start_pushbutton_Callback(hObject, eventdata, handles)

% hObject    handle to start_pushbutton (see GCBO)

% eventdata  reserved - to be defined in a future version of MATLAB

% handles    structure with handles and user data (see GUIDATA)

lamda=get(handles.lamda_slider,'Value');

if lamda >= 622e-9c = [0 0 0;1 0 0],

elseif lamda >= 597e-9c = [0 0 0;1 0.38 0],

elseif lamda >= 577e-9c = [0 0 0;1 1 0],

elseif lamda >= 492e-9c = [0 0 0;0 1 0],

elseif lamda >= 450e-9c = [0 0 0;0 1 1],

elseif lamda >= 435e-9c = [0 0 0;0 0 1],

else c = [0 0 0;0.5 0 0.5],

end

......

matlab slider不可移动,GUI界面能运行,但是_slider不能用,不能控制波长相关推荐

  1. matlab烟雾监测,Matlab火焰烟雾检测(GUI)

    Matlab火焰烟雾检测(GUI) 所属分类:matlab例程 开发工具:matlab 文件大小:11868KB 下载次数:29 上传日期:2020-03-20 00:58:54 上 传 者:for ...

  2. Algorithm之PrA:PrA之nLP非线性规划算法+Matlab 优化工具箱的GUI求解非线性规划

    Algorithm之PrA:PrA之nLP非线性规划算法+Matlab 优化工具箱的GUI求解非线性规划 目录 PrA之nLP非线性规划算法 操作图文教程 PrA之nLP非线性规划算法 (1).编写M ...

  3. MATLAB设计FIR数字滤波器GUI界面

    MATLAB设计FIR数字滤波器GUI界面 目录 MATLAB设计FIR数字滤波器GUI界面 前言 一.GUI界面设计 1.创建工程 2.GUI界面设计 二.代码讲解 1.参数输入 2.单选按钮 3. ...

  4. 基于matlab的图像处理系统GUI

    基于matlab的图像处理系统GUI,支持图像缩放,剪切,旋转,水平镜像,垂直镜像,参数还可以自己设置,边缘处理的五种算法:laplacian算法,Robert算法,canny算法,prewitt算法 ...

  5. MATLAB指纹识别系统GUI界面实现

    MATLAB指纹识别系统GUI界面实现 课题背景 人的指纹各不相同,指纹可以用来确定人的身份,指纹识别技术作为最传统.最成熟的生物识别方式之一,已经在很多领域得以应用.如何对指纹的基本特征进行有效提取 ...

  6. 无图形启动matlab,MATLAB可以不启动图形界面运行

    仅作记录用途 matlab -nodesktop -nosplash 或者 matlab -nodisplay 或者 matlab -nojvm -nosplash matlab程序也可以在命令行里直 ...

  7. Matlab机械臂综合仿真平台,包含运动学、动力学和控制。 MATLAB机器人仿真正逆运动学simulink轨迹规划 机械臂动力学控制等

    Matlab机械臂综合仿真平台,包含运动学.动力学和控制. MATLAB机器人仿真正逆运动学simulink轨迹规划 机械臂动力学控制等 gui控制仿真平台PUMA机器人 robotics toolb ...

  8. matlab计算abc三相短路电流_手把手教你做FOC电机控制MATLAB仿真

    一.整体结构及功能介绍用MATLAB2013以上版本打开文件,看到如图所示界面:可以看到仿真最外层由四个模块组成,电源模块(红色方框),电机与控制模块(蓝色方框),控制信号给定模块(黄色方框),信号分 ...

  9. 【图像分割】基于FCM+KFCM MRI图像分割matlab源码含GUI

    一.简介 1 如何理解模糊聚类\ 事物间的界线,有些是明确的,有些则是模糊的.当聚类涉及到事物之间的模糊界线时,需要运用模糊聚类分析方法.\ 如何理解模糊聚类的"模糊"呢:假设有两 ...

最新文章

  1. 消费机器人今年爆发!四大品类瓜分百亿蛋糕
  2. cubase怎么添加midi设备_Cubase教程丨20分钟快速上手Cubase(下)
  3. (转载)一套完整的UI设计规范手册(IOS版)
  4. presto联合查询mysql和ES_presto-mysql/elasticsearch6.0.0安装部署测试,异种数据源关联查询入门实践...
  5. NLP算法工程师对NLP的一些看法
  6. 20172318 2018-2019-1 《程序设计与数据结构》第9周学习总结
  7. java webserver demo_Java 实现 web服务器的简单实例
  8. dreamweaver 8快捷键
  9. Julia : 如何在Atom中能用上go to definition?
  10. 在vue项目中使用 JSON 编辑器: vue-json-editor
  11. iTextSharp快速使用指南
  12. 草图大师SketchUp 2022 安装教程
  13. David Lowe 的sift代码
  14. java.net.SocketException和错误:org.apache.ftpserver.FtpServerConfigurationException
  15. 第19章 数据库备份与恢复
  16. Linux系统如何查看服务器带宽及网络使用情况
  17. 人脸识别嵌入式Linux芯片瑞芯微RV1109参数介绍
  18. 优秀的LOGO设计都有哪些共同点,是需要我们借鉴的?
  19. 谷歌SEO优化八步走
  20. 透析SpringBoot jar可执行原理

热门文章

  1. left join on用法_MySQL 多表查询 quot;Joinquot;+“case when”语句总结
  2. 剩余 大小 查看内存_谈谈内存压缩那些事
  3. php安装 pear,php pear / pecl 扩展工具的安装和使用
  4. 命令 启动顺序_笔记一: 启动选项与系统变量
  5. qdu_ACM3月7号组队训练
  6. 机器学习线性回归算法实验报告_从零实现机器学习算法(九)线性回归
  7. 机械硬盘 mysql调优_【MYSQL】使用RAID增加传统机器硬盘的性能
  8. 数学--数论--POJ281(线性同余方程)
  9. Swift 网络请求数据与解析
  10. LeetCode Hot100 ---- 回溯算法专题