Thông báo

Collapse
No announcement yet.

Tổng hợp các câu hỏi về Matlab - Trả lời ngay

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

  • co_chichi
    replied
    các Bác giúp e với.e copy toàn bộ đoạn code gpt sau vào của sổ editor của matlab 7.0..nó ko chạy:
    funtion [p1,err,k] = newtonraphson(f,df,po,delta,max1)
    f=inline('sin(tan(x))-tan(sin(x))','x');
    df=inline('cos(tan(x))/(cos(x).^2)-cos(x)/(cos(sin(x)).^2)','x');
    po=input('po=');
    delta=input('delta=');
    max1=input('max1=');
    for k=1:max1
    p1=po-f(po)/df(po);
    err=abs(p1-po);
    po=p1;
    if (err<delta),break,end
    end
    của sổ matlat hiện ra thông báo"Undefined command/function 'funtion'.
    e ko hiểu tại sao lại như vậy nữa
    hj,chắc là e nhầm topic nên ko có ai trả lời giùm

    Leave a comment:


  • haokd
    replied
    minh la dan bat dau hoc matlap.cho minh hoi cac ban di truoc : bgio minh muon tao 1 tin hieu sin 50hz roi phan tich pho furier cua no thi bgio phai lam cac buoc nhu the nao?thay giao minh co yeu cau la fai tao ra tin hieu sin roi rac truoc roi phan tich pho cua no xem co dung = 50hz khong?neu khong thi tai sao?cam on cac ban rất nhieu!

    Leave a comment:


  • muitenxanh87
    replied
    ptnbk50: bạn thử học cách sử dụng tool indetification trong mathlab xem

    Leave a comment:


  • muitenxanh87
    replied
    @linhcan87 : bạn tìm cuốn lập trình và ứng dụng trong mathlab của đhbk và mathlab và simulink cho kĩ sư điều khiển tự động của thầy Nguyễn Phùng Quang và cơ sơ mathlab của cao đẳng sư phạm kỹ thuật hưng yên có tất cả những điều bạn yêu cầu chỉ cần gõ lại chuẩn những ví dụ trong đấy là ok

    Leave a comment:


  • muitenxanh87
    replied
    @thanh3i1: bạn có thể dùng câu lệnh convert trang tham khảo : http://www.mathworks.com/matlabcentr...to-matlab-code phần file exchange có file download còn newgroup có thể trao đổi

    Leave a comment:


  • muitenxanh87
    replied
    @khoan cat be tong : bạn vào similink library browser/simulink/user- Defined Function chọn khối s-function sau đó vào khối đó điền tên m-file vào vi du xxx.m nhấn ok là chạy đc

    Leave a comment:


  • muitenxanh87
    replied
    Mô hình mô phỏng động cơ đồng bộ pu standard chế độ fixstep solver : ode(4) runge kutta bước trích mẫu cố định 0.001s sử dụng thêm khối discrete Ts=0.001s xin hỏi tại sao đặt điện áp đầu vào là 1 thì đầu ra Et lên 10^250 bình thường với bước trích mẫu là 0.0001s thì đầu ra bằng 1 chuản men.Liệu có phải mô hình động cơ đồng bộ của mathlab chỉ đáp ứng với bước trích mẫu chậm nhất là 0.0001s ??

    Leave a comment:


  • thanh3i1
    replied
    bác cho em hỏi một vấn đề với, bây giờ em đang làm một cái gui mà trong đó em cần save lại dữ liệu nằm trong workspace , bác có biết câu lệnh nào có thể làm giúp em được không,
    chương trình đó là khi em ẫn một nút ở chương trình ( ví dụ là nút save ) thì nó sẽ lưu lại dữ liệu ở workspace thành một file data.mat .
    em cảm ơn bác trước

    Leave a comment:


  • linhcan87
    replied
    mình đang làm bài tập dài(bài tập lớn) mà chưa được dạy dùng matlab như thế nào vì mình học CĐ không có trong chương trình học.Thấy nhiều người nói dùng matlab giải mạch sẽ nhanh và chính xác mình muốn thử lại KQ xem đã chuẩn chưa.Tìm trên mạng mà không có 1 bài tập mẫu nào dạy cách dùng cả(cho bài tập lớn).Có rất nhiều hướng dẫn về matlab nhưng không ứng dụng cho bài tập lớn.Vậy cho mình hỏi ai có bài tập mẫu hay cách dùng matlab để giải 1 bài tập dài không nếu có thì bày cho mình với.Hướng dẫn chỉ rõ từng bước nhé.À cho mình hỏi luôn thế phần có hỗ cảm có giải được bằng PP matlab không vậy

    Leave a comment:


  • khoancatbeto
    replied
    chuyển mfile sang block simulink

    Các pác cho mình hỏi kái này với. Có một m-file có đầu vào và đầu ra(viết theo dạng function) làm sao chuyển nó sang các khối trong simulink, theo mình biết dùng chức năng S-Function trong simulink nhưng mình không rành lắm, bạn nào biết thì chỉ cho mình nha. Thank

    Leave a comment:


  • ptnbk50
    replied
    ai giúp em tìm hàm truyền của cái đò thị này với. em đang cần gấp bác nào biết chỉ giáo dùm
    Attached Files

    Leave a comment:


  • buon88
    replied
    hình như diễn đàn đang đi vào suy thoái ^^~

    Leave a comment:


  • buon88
    replied
    Có bác nào hiểu về hàm randn ko giúp thằng em bài này phát , em thứ 2 phải nộp bt lớn :

    Viết chương trình tạo ra một chuỗi x gồm N=1000 số ngẫu nhiên +1 và -1 (Có thể sử dụng hàm randn hoặc hàm rand). Sử dụng phương pháp tương tự tạo chuỗi y gồm N=10000 số ngẫu nhiên +1 và -1. Viết chương trình so sánh tỉ lệ sai khác giữa hai chuỗi x và y.

    Leave a comment:


  • nemo211
    replied
    Em làm gui, muốn đưa hệ số n và coef_number sau khi nhập, vào hàm lab11a.m. Được dùng khi nhấn nút idDCT. Nhưng em làm như dưới thì bị lỗi(như dưới). Mọi người giúp giùm em

    ??? Reference to a cleared variable handles.

    Code:
    Error in ==> C:\Documents and Settings\nemo\Desktop\Lab 2\Code\lab2.m (idDCT_Callback)
    On line 136  ==> BS=get(handles.idBSV,'String')
    
    Error in ==> C:\MATLAB6p5\toolbox\matlab\uitools\gui_mainfcn.m
    On line 66  ==>         feval(varargin{:});
    
    Error in ==> C:\Documents and Settings\nemo\Desktop\Lab 2\Code\lab2.m
    On line 42  ==>     gui_mainfcn(gui_State, varargin{:});
    
    ??? Error while evaluating uicontrol Callback.

    lab11a.m
    Code:
    function [mse,psnr]=lab11a(n,coef_number)
    
    clear;
    clc;
    %--------------------------------------------------
    % in put
    picture ='lena-1.raw';
    %n = 8;
    %coef_number = 10;
    %--------------------------------------------------
    fid = fopen(picture,'r');  
    image = fread(fid,[512 512]);  
    fclose(fid);                   
    image = image';
    %--------------------------------------------------
    Lab2.m
    Code:
    function idBSV_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to idBSV (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
    
    % Hint: popupmenu controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc
        set(hObject,'BackgroundColor','white');
    else
        set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
    end
    
    
    % --- Executes on selection change in idBSV.
    function idBSV_Callback(hObject, eventdata, handles)
    % hObject    handle to idBSV (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    
    % Hints: contents = get(hObject,'String') returns idBSV contents as cell array
    %        contents{get(hObject,'Value')} returns selected item from idBSV
    BS=get(handles.idBSV,'String');
    n=BS{get(handles.idBSV,'Value')};
    
    % --- Executes during object creation, after setting all properties.
    function idCNV_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to idCNV (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
    
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc
        set(hObject,'BackgroundColor','white');
    else
        set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
    end
    
    
    
    function idCNV_Callback(hObject, eventdata, handles)
    % hObject    handle to idCNV (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,'String') returns contents of idCNV as text
    %        str2double(get(hObject,'String')) returns contents of idCNV as a double
    CN=get(handles.idCNV,'String');
    CN=str2num(CN);
    coef_number=CN;
    
    % --- Executes on button press in idDCT.
    function idDCT_Callback(hObject, eventdata, handles)
    % hObject    handle to idDCT (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    clear;
    clc;
    BS=get(handles.idBSV,'String')
    n=BS{get(handles.idBSV,'Value')}
    
    CN=get(handles.idCNV,'String');
    CN=str2num(CN);
    coef_number=CN
    
    [mse,psnr]=lab11a(n,coef_number);
    
    set(handles.idMSEV,'String',num2str(mse));
    set(handles.idPSNRV,'String',num2str(psnr));
    
    % --- Executes on button press in idKLT.
    function idKLT_Callback(hObject, eventdata, handles)
    % hObject    handle to idKLT (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    
    
    % --- Executes on button press in idReset.
    function idReset_Callback(hObject, eventdata, handles)
    % hObject    handle to idReset (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    Last edited by nemo211; 29-03-2010, 12:53.

    Leave a comment:


  • hanggau
    replied
    Mình mới tìm hiểu về simulink trong matlab để mô phỏng hệ thống MIMO OFDM. Đọc tài liệu và ví dụ thì mình vẫn chưa hiểu là khi mô phỏng thì chỉ cần dùng các khối có sẵn trong matlab hay là mình phải lập trình thêm cách xử lý dữ liệu. Và nếu phải lập trình thì mình để code vào đâu trong cái mô hình hệ thống đó? Giúp mình với!!!

    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