Thông báo

Collapse
No announcement yet.

Lập trình GUI trong Matlab

Collapse
This is a sticky topic.
X
X
 
  • Lọc
  • Giờ
  • Show
Clear All
new posts

  • tuongthanbk
    replied
    các bậc tiền bối giúp dùm bài này nhe đang cần gấp lắm. Cảm ơn các bác nhiều
    Đề bài: Tìm giá trị lớn nhất và nhỏ nhất của hàm hai biến trên tập đóng và bị chặn D.
    Yêu cầu: Sử dụng GUI. Cho phép nhập vào hàm 2 biến, nhập vào miền đóng và bị chặn D.
    Output: Giá trị lớn nhất, giá trị nhỏ nhất. Vẽ hình minh họa tại trên miền D.

    Leave a comment:


  • dragonfly111
    replied
    chào mọi người, hiện e đang dùng matlab ver 7.0(r14)
    Trong lập trình giao diện gui, e có dùng đến menu pop-up. Khi run thì pop-up lai hiển thị ntnay"---------"(điều này k ảnh hưởng đến tính toán mà chỉ thuần túy về mặc hiển thị)
    như hình kèm theo!
    Mọi người có thể giúp e giải đáp và khắc phục được k?


    (hjc, sao làm theo hướng dẫn post ảnh bỏ đường link vào img mà sao nó k hiển thị ảnh mà ra đường link ntnay vậy ta)
    Attached Files
    Last edited by dragonfly111; 12-08-2011, 11:17.

    Leave a comment:


  • joke
    replied
    Đường link tới mọi tài liệu hướng dẫn sử dụng Matlba 2011a (version 7.12) - (Xin lỗi, mình lấy ở đây: http://www.mathworks.com/help/pdf_doc/allpdf.html nhưng nó không hề hiển thị link đính kèm khi copy vào diễn đàn, các bác thông cảm, chịu khó đăng nhập vào trang chủ rồi download vậy)

    Printable (PDF) Documentation

    General

    Release Notes for R2011a
    Installation Guide


    MATLAB
    MATLAB Getting Started Guide
    Desktop Tools and Development Environment


    Data Import and Export
    Mathematics
    Data Analysis
    Programming Fundamentals
    MATLAB Programming Tips
    Object-Oriented Programming
    Graphics
    3-D Visualization
    Creating Graphical User Interfaces
    External Interfaces
    MAT-File Format
    MATLAB Release Notes

    Related Papers
    MATLAB ODE Suite
    Implicitly Restarted Arnoldi/Lanczos Methods for Large-Scale Eigenvalue Calculations
    Sparse Matrices in MATLAB: Design and Implementation

    Simulink
    Simulink Getting Started Guide
    Simulink User's Guide
    Simulink Graphical User Interface
    Simulink Reference
    Developing S-Functions
    Simulink Release Notes

    Modeling Guidelines
    Modeling Guidelines for High-Integrity Systems
    Modeling Guidelines for Code Generation
    MathWorks Automotive Advisory Board Control Algorithm Modeling Guidelines Using MATLAB, Simulink, and Stateflow

    MATLAB & Simulink Student Version
    Introduction and Installation Instructions (R2011a Student Version)


    Aerospace Blockset
    Aerospace Blockset User's Guide
    Aerospace Blockset Release Notes

    Aerospace Toolbox
    Aerospace Toolbox User's Guide
    Aerospace Toolbox Release Notes

    Bioinformatics Toolbox
    Bioinformatics Toolbox User's Guide
    Bioinformatics Toolbox Release Notes

    Code Generation from MATLAB
    Code Generation from MATLAB Getting Started Guide
    Code Generation from MATLAB User's Guide
    Code Generation from MATLAB Release Notes

    Communications System Toolbox
    Communications System Toolbox Getting Started Guide
    Communications System Toolbox User's Guide
    Communications System Toolbox Release Notes

    Computer Vision System Toolbox
    Computer Vision System Toolbox User's Guide
    Computer Vision System Toolbox Release Notes

    Control System Toolbox
    Control System Toolbox Getting Started Guide
    Control System Toolbox User's Guide
    Control System Toolbox Release Notes

    Curve Fitting Toolbox
    Curve Fitting Toolbox User's Guide
    Curve Fitting Toolbox Release Notes

    Data Acquisition Toolbox
    Data Acquisition Toolbox User's Guide
    Data Acquisition Toolbox Quick Reference Guide
    Data Acquisition Toolbox Adaptor Kit User's Guide
    Data Acquisition Toolbox Release Notes

    Database Toolbox
    Database Toolbox Getting Started Guide
    Database Toolbox User's Guide
    Database Toolbox Release Notes

    Datafeed Toolbox
    Datafeed Toolbox User's Guide
    Datafeed Toolbox Release Notes

    DO Qualification Kit
    DO Qualification Kit User's Guide
    DO Qualification Kit Model-Based Design Workflow for DO-178B
    DO Qualification Kit Release Notes

    DSP System Toolbox
    DSP System Toolbox Getting Started Guide
    DSP System Toolbox User's Guide
    DSP System Toolbox Release Notes

    Econometrics Toolbox
    Econometrics Toolbox User's Guide
    Econometrics Toolbox Release Notes

    EDA Simulator Link
    EDA Simulator Link Getting Started Guide
    EDA Simulator Link User's Guide
    EDA Simulator Link Release Notes

    Embedded Coder
    Embedded Coder Getting Started Guide
    Embedded Coder User's Guide
    Embedded Coder Reference
    Embedded Coder Release Notes

    Filter Design HDL Coder
    Filter Design HDL Coder User's Guide
    Filter Design HDL Coder Release Notes

    Financial Derivatives Toolbox
    Financial Derivatives Toolbox User's Guide
    Financial Derivatives Toolbox Release Notes

    Financial Toolbox
    Financial Toolbox User's Guide
    Financial Toolbox Release Notes

    Fixed-Income Toolbox
    Fixed-Income Toolbox User's Guide
    Fixed-Income Toolbox Release Notes

    Fixed-Point Toolbox
    Fixed-Point Toolbox User's Guide
    Fixed-Point Toolbox Release Notes

    Fuzzy Logic Toolbox
    Fuzzy Logic Toolbox User's Guide
    Fuzzy Logic Toolbox Release Notes

    Gauges Blockset
    Gauges Blockset User's Guide
    Gauges Blockset Release Notes

    Global Optimization Toolbox
    Global Optimization Toolbox User's Guide
    Global Optimization Toolbox Release Notes

    IEC Certification Kit
    IEC Certification Kit User's Guide
    IEC Certification Kit Release Notes

    Image Acquisition Toolbox
    Image Acquisition Toolbox User's Guide
    Image Acquisition Toolbox Adaptor Kit User's Guide
    Image Acquisition Toolbox Release Notes

    Image Processing Toolbox
    Image Processing Toolbox User's Guide
    Image Processing Toolbox Release Notes

    Instrument Control Toolbox
    Instrument Control Toolbox User's Guide
    Instrument Control Toolbox Release Notes

    Mapping Toolbox
    Mapping Toolbox User's Guide
    Mapping Toolbox Release Notes

    MATLAB Builder EX
    MATLAB Builder EX User's Guide
    MATLAB Builder EX Release Notes

    MATLAB Builder JA
    MATLAB Builder JA User's Guide
    MATLAB Builder JA Release Notes
    MATLAB Application Deployment Web Example Guide

    MATLAB Builder NE
    MATLAB Builder NE User's Guide
    MATLAB Builder NE Release Notes
    MATLAB Application Deployment Web Example Guide

    MATLAB Coder
    MATLAB Coder Getting Started Guide
    MATLAB Coder User's Guide
    MATLAB Coder Release Notes

    MATLAB Compiler
    MATLAB Compiler User's Guide
    MATLAB Compiler Release Notes
    MATLAB Application Deployment Web Example Guide

    MATLAB Distributed Computing Server
    MATLAB Distributed Computing Server System Administrator's Guide
    Parallel Computing Toolbox User's Guide
    Parallel Computing Toolbox Release Notes

    MATLAB Report Generator
    MATLAB Report Generator User's Guide
    MATLAB Report Generator Release Notes

    Model-Based Calibration Toolbox
    Model-Based Calibration Toolbox Getting Started Guide
    Model-Based Calibration Toolbox Model Browser User's Guide
    Model-Based Calibration Toolbox CAGE User's Guide
    Model-Based Calibration Toolbox Release Notes

    Model Predictive Control Toolbox
    Model Predictive Control Toolbox Getting Started Guide
    Model Predictive Control Toolbox User's Guide
    Model Predictive Control Toolbox Release Notes

    Neural Network Toolbox
    Neural Network Toolbox Getting Started Guide
    Neural Network Toolbox User's Guide
    Neural Network Toolbox Release Notes

    OPC Toolbox
    OPC Toolbox User's Guide
    OPC Toolbox Release Notes

    Optimization Toolbox
    Optimization Toolbox User's Guide
    Optimization Toolbox Release Notes

    Parallel Computing Toolbox
    Parallel Computing Toolbox User's Guide
    Parallel Computing Toolbox Release Notes
    MATLAB Distributed Computing Server System Administrator's Guide

    Partial Differential Equation Toolbox
    Partial Differential Equation Toolbox User's Guide

    Phased Array System Toolbox
    Phased Array System Toolbox Getting Started Guide
    Phased Array System Toolbox User's Guide
    Phased Array System Toolbox Release Notes

    Polyspace Code Verification Products
    Polyspace Products for C Getting Started Guide
    Polyspace Products for C User's Guide
    Polyspace Products for C Reference
    Polyspace Products for C++ Getting Started Guide
    Polyspace Products for C++ User's Guide
    Polyspace Products for C++ Reference
    Polyspace Products for Ada Getting Started Guide
    Polyspace Products for Ada User's Guide
    Polyspace Products for Ada Reference
    Polyspace Model Link Products User's Guide
    Polyspace UML Link RH User's Guide
    Polyspace Installation Guide
    Polyspace Release Notes

    Real-Time Windows Target
    Real-Time Windows Target User's Guide
    Real-Time Windows Target Release Notes

    RF Toolbox
    RF Toolbox User's Guide
    RF Toolbox Release Notes

    Robust Control Toolbox
    Robust Control Toolbox Getting Started Guide
    Robust Control Toolbox User's Guide
    Robust Control Toolbox Release Notes

    SB2SL
    SB2SL User's Guide
    SB2SL Release Notes

    Signal Processing Toolbox
    Signal Processing Toolbox Getting Started Guide
    Signal Processing Toolbox User's Guide
    Signal Processing Toolbox Release Notes

    SimBiology
    SimBiology Getting Started Guide
    SimBiology User's Guide
    SimBiology Release Notes

    SimDriveline
    SimDriveline User's Guide
    SimDriveline Release Notes

    SimElectronics
    SimElectronics User's Guide
    SimElectronics Release Notes

    SimEvents
    SimEvents Getting Started Guide
    SimEvents User's Guide
    SimEvents Release Notes

    SimHydraulics
    SimHydraulics User's Guide
    SimHydraulics Release Notes

    SimMechanics
    SimMechanics Getting Started Guide
    SimMechanics User's Guide
    SimMechanics Visualization and Import Guide
    SimMechanics Release Notes

    SimMechanics Link
    SimMechanics Link User's Guide
    SimMechanics Link Release Notes

    SimPowerSystems
    SimPowerSystems User's Guide
    SimPowerSystems Release Notes

    SimRF
    SimRF Getting Started Guide
    SimRF User's Guide
    SimRF Release Notes
    RF Blockset User's Guide
    RF Blockset Release Notes

    Simscape
    Simscape Getting Started Guide
    Simscape User's Guide
    Simscape Language Guide
    Simscape Release Notes

    Simulink 3D Animation
    Simulink 3D Animation User's Guide
    Simulink 3D Animation Release Notes

    Simulink Coder
    Simulink Coder Getting Started Guide
    Simulink Coder User's Guide
    Simulink Coder Target Language Compiler
    Simulink Coder Reference
    Simulink Coder Release Notes

    Simulink Control Design
    Simulink Control Design Getting Started Guide
    Simulink Control Design User's Guide
    Simulink Control Design Release Notes

    Simulink Design Optimization
    Simulink Design Optimization Getting Started Guide
    Simulink Design Optimization User's Guide
    Simulink Design Optimization Release Notes

    Simulink Design Verifier
    Simulink Design Verifier User's Guide
    Simulink Design Verifier Release Notes

    Simulink Fixed Point
    Simulink Fixed Point User's Guide
    Simulink Fixed Point Release Notes

    Simulink HDL Coder
    Simulink HDL Coder User's Guide
    Simulink HDL Coder Release Notes

    Simulink PLC Coder
    Simulink PLC Coder User's Guide
    Simulink PLC Coder Release Notes

    Simulink Report Generator
    Simulink Report Generator User's Guide
    Simulink Report Generator Release Notes

    Simulink Verification and Validation
    Simulink Verification and Validation User's Guide
    Simulink Verification and Validation Reference
    Simulink Verification and Validation Release Notes

    Spreadsheet Link EX
    Spreadsheet Link EX User's Guide
    Spreadsheet Link EX Release Notes

    Stateflow
    Stateflow Getting Started Guide
    Stateflow User's Guide
    Stateflow Reference
    Stateflow API
    Stateflow Release Notes

    Statistics Toolbox
    Statistics Toolbox User's Guide
    Statistics Toolbox Release Notes

    Symbolic Math Toolbox
    Symbolic Math Toolbox User's Guide
    Symbolic Math Toolbox Release Notes
    MuPAD Tutorial

    System Identification Toolbox
    System Identification Toolbox Getting Started Guide
    System Identification Toolbox User's Guide
    System Identification Toolbox Release Notes

    SystemTest
    SystemTest User's Guide
    SystemTest Release Notes

    Vehicle Network Toolbox
    Vehicle Network Toolbox User's Guide
    Vehicle Network Toolbox Release Notes

    Wavelet Toolbox
    Wavelet Toolbox Getting Started Guide
    Wavelet Toolbox User's Guide
    Wavelet Toolbox Release Notes

    xPC Target
    xPC Target Getting Started Guide
    xPC Target User's Guide
    xPC Target API Guide
    xPC Target Device Drivers
    xPC Target Release Notes

    Leave a comment:


  • dragonfly111
    replied
    @lemanno000
    gửi bạn file đính kèm để tham khảo,cái này mình cũng tìm được trên mạng!
    Attached Files

    Leave a comment:


  • lemanno000
    replied
    nhờ mấy anh giúp e với!
    để tính số lần nhấp 1 nút nhấn trong guide matlab thì ta phải lập trình sao dzi.!
    e sắp nộp đồ án rồi mấy anh giúp e với

    Leave a comment:


  • dragonfly111
    replied
    chào các bạn,mình có 1 vấn đề nhỏ mong các bạn giúp mình!
    Mình tạo ra 2 gui (gui1 và gui2), khi mở gui2 từ gui1 thì gui1 lúc đó đóng lại và mở gui2. Tuy nhiên khi twf gui2 quaylai gui1 thì toàn bộ các giá trị nhập cũng như kết quả trước đó tại gui1 mất hết.
    Các bạn có thể giúp mình làm sao để dữ liệu tại gui1 vẫn giữ nguyên mà k mất đi k?
    Ah, các bạn có thể cho mình 1 ví dụ về biến toàn cục global hoặc có giải thích và cách thwcj hiện ntn giúp mình với được k?
    Cảm ơn các bạn nhiều!
    Happy day!
    Last edited by dragonfly111; 22-05-2011, 17:16.

    Leave a comment:


  • thandieu
    replied
    @ngocson0: Bạn chưa khai báo biến KOS nên chương trình không hiểu. Tức là ban đầu biến KOS phải có một giá trị nào đó.

    @takeru1906: Bạn có thể nói rõ câu hỏi hơn ko? Giá trị A nhập ở đâu, hình B hiển thị ở đâu...?

    Leave a comment:


  • takeru1906
    replied
    Nhờ anh (chi) giúp đỡ

    Em bây jo muốn làm GUI Matlab , em tính khi nhập các giá trị A (cố định) này thì nó sẽ hiển thị hình B mà mình muốn lên ( ko cần phải qua tính toán ) có nghĩa là giá trị A này gắn với một hình B mà mình đã biết . Thì phải làm thế nào hả các bác ? mong nhận dc chỉ giúp ah

    Leave a comment:


  • ngocson0
    replied
    Xin chào tất cả các anh em!
    Em đang lập trình chương trình nhỏ để tính chuyển vị của hệ kết cấu thanh giàn
    Nhưng gặp một số lỗi xin mấy huynh chỉ giúp em với:
    Đây là chương trình chính
    clc
    clear
    format compact
    non=3;
    noe=3;
    nonpe=2;
    nodofpn=2;
    nodofos=non*nodofpn;
    coord(1,1)=0;
    coord(1,2)=0;
    coord(2,1)=0;
    coord(2,2)=1;
    coord(3,1)=1;
    coord(3,2)=1;
    E=2.00e7;
    A=0.02;
    elem(1,1)=1;
    elem(1,2)=2;
    elem(2,1)=1;
    elem(2,2)=3;
    elem(3,1)=2;
    elem(3,2)=3;
    noress =4;
    ixres(1)=1;
    vodof(1)=0;
    ixres(2)=2;
    vodof(2)=0;
    ixres(3)=3;
    vodof(3)=0;
    ixres(4)=4;
    vodof(4)=0;
    K=zeros(nonpe*nodofpn,nonpe*nodofpn);
    ix=zeros(nonpe*nodofpn,1);
    f=zeros(nodofos,1);
    f(5)=300;
    f(6)=-600;
    for ie=1:noe
    endoe(1)=1;
    endoe(2)=2;
    x1=coord(endoe(1),1);
    y1=coord(endoe(1),2);
    x2=coord(endoe(2),1);
    y2=coord(endoe(2),2);
    L=sqrt((x2-x1)^2+(y2-y1)^2);
    if(x2-x1)==0;
    alpha=2*atan(1);
    else
    alpha=atan((y2-y1)/(x2-x1));
    end
    K=smotrusselem(E,L,A,alpha);
    ix=indexos(endoe,nonpe,nodofpn);
    KOS=smos(KOS,K,ix);
    end
    [KOS,f]= proores(KOS,ixres,vodof);
    u=KOS\f;
    id=1:nodofos;
    disp=[id' u];
    Có 4 hàm để giúp chương trình chính chạy như sau:
    function [ix] =indexos(endoe,nonpe,nodofpn)
    k=0;
    for i=1:nonpe
    s=(endoe(i)-1)*nodofpn;
    for j = 1:nodofpn
    k=k+1;
    ix(k)=s+j;
    end
    end


    function[KOS,f]=proores(KOS,f,ixres,vodof)
    m=length(ixres);
    n=length(KOS);
    for i=1:m
    c=ixres(i);
    for j=1:n
    KOS(c,j)=0;
    KOS(j,c)=0;
    end
    KOS(c,c)=1;
    f(c)=vodof(i);
    end


    function [KOS]=smos(KOS,K,ix)
    for i =1:length(ix)
    is=ix(i);
    for j=1:length(ix);
    js=ix(j);
    KOS(is,js)=KOS(is,js)+K(i,j);
    end
    end

    function [K] = smotrusselem(E,A,L,alpha);
    c=cos(alpha);
    s=sin(alpha);
    K=(E*A/L)*[ c*c c*s -c*c -c*s
    c*c s*s -c*c -s*s
    -c*c -c*s c*c c*s
    -c*c -c*s -c*c s*s ]
    Kết quả chạy báo lỗi như sau:
    K =
    1.0e+009 *
    0.0000 0.0000 -0.0000 -0.0000
    0.0000 1.0000 -0.0000 -1.0000
    -0.0000 -0.0000 0.0000 0.0000
    -0.0000 -0.0000 -0.0000 1.0000
    ??? Undefined function or variable 'KOS'.

    Error in ==> hedanchinh at 52
    KOS=smos(KOS,K,ix);
    Làm ơn chỉ giùm lỗi giúp em với nhé!

    Leave a comment:


  • tuthantuthuc
    replied
    Có ai giúp dùm em với. Em muốn tạo 1 GUI để mô phỏng động cơ DC bằng không gian trạng thái, em đã lấy được các thông số của động cơ từ GUI và tính ra được ma trận trạng thái, nhưng khi dùng lệnh set_param để đưa các ma trận này vào các tham số A,B,C,D thì nó lại báo lỗi. Cụ thể như sau:
    Với R,L,Ke,Phi,J là các tham số được lấy từ GUI
    [B]a11=-R/L;

    a12=-Ke*Phi/L;

    a21=Km*Phi/2/pi/J;

    b11=1/L;

    b22=-1/2/pi/J;

    A = [a11 a12 ; a21 0];
    B = [b11 0 ; 0 b22];
    C = [1 0 ; 0 1];
    D = [0 0 ; 0 0];

    G_m = ss(A, B, C, D);
    minfo(G_m);

    a11=num2str(a11)
    a12=num2str(a12)
    a21=num2str(a21)
    b11=num2str(b11)
    b22=num2str(b22)
    % DCM_MP la ten file simulink, DCMOTOR la khong gian trang thai

    set_param('DCM_MP/DCMOTOR','A', '[A]','B',...
    '','C','[1 0 ; 0 1]','D','[0 0 ; 0 0]')

    Em cũng đã thử bằng lệnh sau nhưng k được:
    set_param('DCM_MP/DCMOTOR','A', ['[',a11, ' ' ,a12 ; a21, ' ', 0,']'],'B',...
    ['[',b11, ' ' ,0 ; 0, ' ', b22,']'],'C','[1 0 ; 0 1]','D','[0 0 ; 0 0]')

    hoặc
    set_param('DCM_MP/DCMOTOR','A','[ a11 a12 ; a21 0]', 'B', '[ b11 0 ; 0 b22 ]', 'C' ,'[1 0 ; 0 1]',...
    'D','[0 0 ; 0 0]')

    Nhưng khi em thay bằng số thì file simulink lại chạy được. Kính mong các anh có kinh nghiệm giúp dùm vaa61n đề này với em xin cám ơn

    Leave a comment:


  • coolqnvn
    replied
    Cái này bạn tim trong tài liệu matlab and simulink cua Nguyễn Phùng Quang viết rất cụ thể.
    kai này kũng đơn giản thôi mà.chịu khó đọc tài liệu 1 chút la làm được ngay
    thân!

    Leave a comment:


  • anhteen
    replied
    có ai giúp mình với

    Leave a comment:


  • anhteen
    replied
    chào các bạn,....

    k bik các bạn có bik code chuyển tiền từ VND sang USD và ngược lại đc k...

    làm bằng giao điện GUI trong Matlab...

    cám ơn các bạn rất nhiều...

    style_trungxiteen@yahoo.com

    Leave a comment:


  • kissyou
    replied
    Anh ơi cho em hỏi, khi muốn load data từ các function khác trong 1 form thì mình dùng lệnh:

    handles.A1=A
    guidata(hObject,handles)
    Vậy khi em muốn load data từ 2 form khác nhau thì dùng cách nào hả anh. 1 bài em cần dùng rất nhiều form, mà các form thì cần liên kết dữ liệu với nhau. Anh giúp em với. Thanh anh

    Leave a comment:


  • kissyou
    replied
    Nguyên văn bởi jayacepalius Xem bài viết
    Chào các anh!
    Em đã thiết lập dc giao diện GUI bằng m-file (ko dùng Fig)
    Nhưng quá trình xử lí đòi hỏi phải nhấn nút các Button tuần tự (6,7 cái Button j đó)
    vậy mấy anh cho em hỏi có cách nào màinh thiết lập cho các nút nhấn đó tự auto tác động sau t giây nào đó
    Ví dụ, GUI có 6 nút nhấn: Start, Load ảnh, cân bằng xám, nhị phân hóa ảnh, lọc ảnh, luưu ảnh sau xử lí.
    Sau khi load ảnh xong, mình bấm start thì nó tuần tự tác động (thưc thi) các nút còn lại, mình ko cần tác động
    Mong các nah chỉ giúp
    ...............................

    Leave a comment:

Về tác giả

Collapse

ngohaibac Tìm hiểu thêm về ngohaibac

Bài viết mới nhất

Collapse

Đang tải...
X