Search Results

Search found 1051 results on 43 pages for 'lebland matlab'.

Page 10/43 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Matlab regex if statement

    - by Dan
    I want to have matlab take user input but accept both cases of a letter. For example I have: function nothing = checkGC(gcfile) if exist(gcfile) reply = input('file exists, would you like to overwrite? [Y/N]: ', 's'); if (reply == [Yy]) display('You have chosen to overwrite!') else $ Do nothing end end The if statement obviously doesn't work, but basically I want to accept a lowercase or uppcase Y. Whats the best way to do this?

    Read the article

  • Evaluating and graphing functions in Matlab

    - by thiol3
    New to programming, I am trying to graph the following Gaussian function in Matlab (should graph in 3 dimensions) but am making some mistakes somewhere. What is wrong? sigma = 1 for i = 1:20 for j = 1:20 z(i,j) = (1/(2*pi*sigma^2))*exp(-(i^2+j^2)/(2*sigma^2)); end end surf(z)

    Read the article

  • compilation of image stitching code in matlab

    - by chee
    i am facing lots of problems while running code for image stitching given at this link http://se.cs.ait.ac.th/cvwiki/matlab:tutorial:image_stitching_from_high-view_images_using_homography may i get help regarding this type of problems here. EDIT: Image stitching code fails with the following message: ??? Undefined function or variable 'x2'. Error in ==compute_direct_homography at 26 amplified_x2=x2.*repmat([diagonal_ratio(x1,x2) diagonal_ratio(x1,x2) 1]',1,size(x2,2)); %assumption 1degree of lat and long =110,000 meters refer wiki Error in == project at 3 compute_direct_homography;

    Read the article

  • Funny plots in MATLAB

    - by Arkapravo
    I recently learned the ezplot function in MATLAB. Recently I typed in ezplot('x^y - y^x', [-100 100 -100 100]); and this is what I got; Can anyone please tell me whatever is happening ? for lower scaling of x and y ( [ -10 10 -10 10]) there are more patterns in the 2nd 3rd and 4th quadrants. I was not very sure of the shape of curve, but I did not expect this !

    Read the article

  • How to parse the file name and rename in Matlab

    - by Paul
    I am reading a .xls file and then procesing it inside and rewriting it in the end of my program. I was wondering if someone can help me to parse the dates as my input file name is like file_1_2010_03_03.csv and i want my outputfile to be newfile_2010_03_03.xls is there a way to incorporate in matlab program so i do not have to manually write the command xlswrite('newfile_2010_03_03.xls', M); everytime and change the dates as i input files with diff dates like file_2_2010_03_04.csv. Thanks

    Read the article

  • Numpy/Python performing terribly vs. Matlab

    - by Nissl
    Novice programmer here. I'm writing a program that analyzes the relative spatial locations of points (cells). The program gets boundaries and cell type off an array with the x coordinate in column 1, y coordinate in column 2, and cell type in column 3. It then checks each cell for cell type and appropriate distance from the bounds. If it passes, it then calculates its distance from each other cell in the array and if the distance is within a specified analysis range it adds it to an output array at that distance. My cell marking program is in wxpython so I was hoping to develop this program in python as well and eventually stick it into the GUI. Unfortunately right now python takes ~20 seconds to run the core loop on my machine while MATLAB can do ~15 loops/second. Since I'm planning on doing 1000 loops (with a randomized comparison condition) on ~30 cases times several exploratory analysis types this is not a trivial difference. I tried running a profiler and array calls are 1/4 of the time, almost all of the rest is unspecified loop time. Here is the python code for the main loop: for basecell in range (0, cellnumber-1): if firstcelltype == np.array((cellrecord[basecell,2])): xloc=np.array((cellrecord[basecell,0])) yloc=np.array((cellrecord[basecell,1])) xedgedist=(xbound-xloc) yedgedist=(ybound-yloc) if xloc>excludedist and xedgedist>excludedist and yloc>excludedist and yedgedist>excludedist: for comparecell in range (0, cellnumber-1): if secondcelltype==np.array((cellrecord[comparecell,2])): xcomploc=np.array((cellrecord[comparecell,0])) ycomploc=np.array((cellrecord[comparecell,1])) dist=math.sqrt((xcomploc-xloc)**2+(ycomploc-yloc)**2) dist=round(dist) if dist>=1 and dist<=analysisdist: arraytarget=round(dist*analysisdist/intervalnumber) addone=np.array((spatialraw[arraytarget-1])) addone=addone+1 targetcell=arraytarget-1 np.put(spatialraw,[targetcell,targetcell],addone) Here is the matlab code for the main loop: for basecell = 1:cellnumber; if firstcelltype==cellrecord(basecell,3); xloc=cellrecord(basecell,1); yloc=cellrecord(basecell,2); xedgedist=(xbound-xloc); yedgedist=(ybound-yloc); if (xloc>excludedist) && (yloc>excludedist) && (xedgedist>excludedist) && (yedgedist>excludedist); for comparecell = 1:cellnumber; if secondcelltype==cellrecord(comparecell,3); xcomploc=cellrecord(comparecell,1); ycomploc=cellrecord(comparecell,2); dist=sqrt((xcomploc-xloc)^2+(ycomploc-yloc)^2); if (dist>=1) && (dist<=100.4999); arraytarget=round(dist*analysisdist/intervalnumber); spatialsum(1,arraytarget)=spatialsum(1,arraytarget)+1; end end end end end end Thanks!

    Read the article

  • showing .tif images in matlab

    - by sepideh
    I am trying to show a .tif image in matlab and I use these two line of codes a = imread('C:\Users\sepideh\Desktop\21_15.tif'); imshow(a) that encounters this warning Warning: Image is too big to fit on screen; displaying at 3% In imuitools\private\initSize at 73 In imshow at 262 what is the cause of this warning and what can I do to fix that? the main trouble is it sometimes doesn't show the image and of course even if it shows the image CPU usage gets high that I can't zoom properly

    Read the article

  • Reading images from file in MATLAB

    - by yalcin
    Hello, I have bmp images in image folder on my computer. I named it from 1.bmp to 100.bmp. And I want to read these images like this: for i=1:100 s='C:\images'+i+'.bmp'; A=imread(s); end But Matlab gave an error. How can I implement this?

    Read the article

  • Matlab - building an array while looping

    - by Mark
    Hello, I have a for loop that loops over one array... for i=1:length(myArray) In this loop, I want to do check on the value of myArray and add it to another array myArray2 if it meets certain conditions. I looked through the Matlab docs, but couldn't find anything on creating arrays without declaring all their values on initialization or reading data into them in one shot. Many thanks!

    Read the article

  • Gaussian filter in Matlab

    - by md86
    Does the 'gaussian' filter in MatLab convolve the image with the Gaussian kernel? Also, how do you choose the parameters hsize (size of filter) and sigma? What do you base it on? etc

    Read the article

  • MATLAB : search and count (?)

    - by Arkapravo
    Some MATLAB help needed ! I have an set of 1s and 0s, I need to find how many 1s and how many 0s. (i.e. x = [ 1 1 0 0 0 0 0 1 0 0 1 1 ....] ) . I was looking at some search and count inbuilt function, however I have not been successful.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >