MATLAB Tips and Tricks

Wednesday, December 22, 2004

The MATLAB blog

Over the course of my research and work I have accumulated a fair share of MATLAB hacks where I have used MATLAB to accomplish tasks that go beyond the usual equation-solving and numerical-simulations routines. Mostly I have been motivated by my own laziness and reluctance to code everything in C, or to use a combination of tools, but as I have discovered along the way, MATLAB is truly a very powerful tool and allows you to accomplish complicated stuff using very simple commands. If you have any interesting ways of using MATLAB, feel free to send them in and I will duly acknowledge your contribution. Enjoy!

18 Comments:

  • At 6:48 AM, Blogger charles said…

    your blog seems very interesting, do you know LP.org:
    http://en.literateprograms.org

    it has a matlab section in which you could add and comment your code. I use it personnaly and find this very usefull (see the "code" tab on the top of the pages),
    Charles

     
  • At 10:14 AM, Blogger Aneet said…

    One of the interesting things is to use the in-built matlab command, RECTANGLE, with a curvature paramenter to draw a circle!

    There is also a method of converting a cell array to a normal array. Consider the cell array c{i,j}

    A = [c{:}];
    converts the cell array to a normal one!

     
  • At 2:15 AM, Anonymous Anonymous said…

    <>

     
  • At 2:17 AM, Anonymous Hemanth Gaekwad said…

    < Is there any tool like SimAuto.If yes Anyone working on SimAuto?>

     
  • At 11:15 PM, Anonymous Anonymous said…

    I am trying to find out more about MATLAB users, and I want to know if anyone uses the Optimization Toolbox??? Why do you prefer this optimizer versus other optimizers on the market? Why would or wouldn't you make the switch? Why would or wouldn't you purchase a different optimizer plug-in to MATLAB's interface??? I'm not biased, but I am really curious to hear what people think! Thanks!

     
  • At 11:35 AM, Anonymous Anonymous said…

    hi, i am an student. i get an project on image processing.please can anyone tell me why MATLAB is good tool for image processing?
    i found another tool CVIP tool. please can anyone tell me which one is good and why.
    if anyone can tell me please then help me it will be a great help for me.
    waiting for reply. thank all of u for you help if any u can do.

     
  • At 2:29 PM, Blogger Anil said…

    Image processing (like any other signal processing) involves plenty of matrix manipulation which is MATLAB's forte. You will also find the image processing toolbox useful (which you will probably have at your university)

    For most of your work though, do check out Octave which will give you a lot of functionality for free.

     
  • At 4:19 AM, Anonymous akash said…

    ya i know matab is good tool.But my Guide want a comparison between matab and other tools like CVIP.I searched a lot on net but there is no such thing related to comparison. so can anyone tell me what is the good feature of matlab over CVIP tool. And why matlab is best. or is there any other tool which is better then matlab then lz tell me...

    thank for ur effort and help

     
  • At 12:48 PM, Anonymous Anonymous said…

    Kostenloses Mathematikprogramm wie MATLAB und kompatibel zu MATLAB:

    Bericht

     
  • At 11:43 PM, Anonymous Treasure said…

    i am trying to do VRP optimisation in Matlab. pls someone can help me with the coding as i am standstill now...Stuck with a situation of how to goahead .URGENT.PLs help

     
  • At 1:14 PM, Blogger T4Tapan said…

    I am looking to download embedded target....

     
  • At 1:03 PM, Anonymous Anonymous said…

    Can anyone help me here - I'm a new Matlab user and having problems getting this to run. This equation will not compute correctly:

    The code starts here:

    clear
    clc
    g = 32.2
    row = 0.00238


    prompt = {'Enter the UAV weight in lbs:', 'Enter the UAV Max airspeed in knots:', 'Enter the UAV Max altitude in feet:','Enter the UAV loss of comms in seconds:'};
    title = 'Hazard Pattern Dynamic Data';
    lines = 1;
    answerdynamic = inputdlg(prompt, title, lines);

    button=questdlg('Does the UAV contain a parachute?', 'Yes','No');
    if strcmp(button, 'Yes');
    prompt = {'What is the parachute Cd?','What is the parachute cross sectional area in feet squared?'};
    title = 'Parachute Information';
    lines = 1;
    answerpara = inputdlg(prompt, title, lines);
    else
    end



    WT=answerdynamic{1,1}
    VS=answerdynamic{2,1}
    ALT=answerdynamic{3,1}
    COMM=answerdynamic{4,1}
    CD=answerpara{1,1}
    CAREA=answerpara{2,1}

    Dist=(VS*(0.59209))*COMM

     
  • At 11:59 AM, Blogger med-enis said…

    i dont understand very well how to use s-fonction for the control of hybride state space can u please sendme a document or give me some information to mohamedbahloul.ge@yahoo.fr

     
  • At 12:03 PM, Blogger med-enis said…

    i dont understand very well how to use s-fonction for hybride controle of state space can u send me a document or some information

     
  • At 3:27 AM, Blogger Paras said…

    hey i'm having problem with skeletonization...hav neone been involved in skeletonization........

     
  • At 3:31 AM, Blogger Paras said…

    here's the code i wrote...its giving no where close to the result required...........
    function [row,col]=skl(bpm),
    [nrows,ncols]=size(bpm);
    bpm(1,:)=0; bpm(:,1)=0;
    for col=2:ncols-1
    for row=2:nrows-1
    if bpm(row,col)>0
    if bpm(row-1,col)== 0
    if bpm(row,col-1)== 0
    if bpm(row,col+1)>0
    if bpm(row+1,col+1)>0
    if bpm(row+1,col)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end

    if bpm(row,col)>0
    if bpm(row-1,col)> 0
    if bpm(row,col-1)== 0
    if bpm(row,col+1)>0
    if bpm(row+1,col) == 0
    if bpm(row-1,col+1)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end
    if bpm(row,col)>0
    if bpm(row-1,col+1)> 0
    if bpm(row,col+1)> 0
    if bpm(row,col-1)==0
    if bpm(row+1,col+1) > 0
    bpm(row,col) == 0
    end
    end
    end
    end

    %north part starts here....

    if bpm(row,col)>0
    if bpm(row-1,col)== 0
    if bpm(row,col-1)> 0
    if bpm(row,col+1)== 0
    if bpm(row+1,col-1)>0
    if bpm(row+1,col)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end

    if bpm(row,col)>0
    if bpm(row-1,col)== 0
    if bpm(row,col-1)== 0
    if bpm(row,col+1)>0
    if bpm(row+1,col+1)>0
    if bpm(row+1,col)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end
    if bpm(row,col)>0
    if bpm(row-1,col)== 0
    if bpm(row+1,col)> 0
    if bpm(row+1,col+1)>0
    if bpm(row+1,col-1) > 0
    bpm(row,col) == 0
    end
    end
    end
    end
    %east part starts here......
    if bpm(row,col)>0
    if bpm(row-1,col)> 0
    if bpm(row,col+1)== 0
    if bpm(row+1,col)== 0
    if bpm(row,col-1) >0
    if bpm(row-1,col-1)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end

    if bpm(row,col)>0
    if bpm(row-1,col)== 0
    if bpm(row,col-1)> 0
    if bpm(row,col+1)== 0
    if bpm(row+1,col-1)>0
    if bpm(row+1,col)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end

    if bpm(row,col)>0
    if bpm(row,col-1)> 0
    if bpm(row-1,col-1)> 0
    if bpm(row+1,col-1)>0
    if bpm(row,col+1) == 0
    bpm(row,col) == 0
    end
    end
    end
    end

    % south part starts here

    if bpm(row,col)>0
    if bpm(row-1,col)> 0
    if bpm(row,col-1)== 0
    if bpm(row,col+1)>0
    if bpm(row+1,col) == 0
    if bpm(row-1,col+1)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end

    if bpm(row,col)>0
    if bpm(row-1,col)> 0
    if bpm(row,col+1)== 0
    if bpm(row+1,col)== 0
    if bpm(row,col-) >0
    if bpm(row-1,col-1)>0
    bpm(row,col)== 0
    end
    end
    end
    end
    end
    end

    if bpm(row,col)>0
    if bpm(row-1,col-1)> 0
    if bpm(row-1,col+1)> 0
    if bpm(row-1,col)> 0
    if bpm(row,col+1) == 0
    bpm(row,col) == 0
    end
    end
    end
    end

    end
    end

     
  • At 2:48 AM, Blogger Paras said…

    i know tht the above code is screwed....but plz help me soon

     
  • At 4:06 AM, Blogger Windhu said…

    need help
    I'm a newbie at the matlab field, I got a final assignment on my university of making a very simple rainfall prediction. it simply predicts the amount of rainfall (in kg/square meters) from thye temperature(in celcius) and the moisture of the air, with possibly other inputs but these are the most prominent ones. to be honest I am not really in to matlab, but in order to finish school quick, I gotta bite the bullet, can anyone give a simple program script that answers this task, I tried to use neural networks but got confused trying to find the best method, need help. reach me here syaputra84@gmail.com thank you.

     

Post a Comment

<< Home