Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by JockeK

  1. JockeK

    Good way to catalog Matlab code?

    A quick method is to create a preparsed pseudocode file using the pcode function of your m-file and put the p-file on the network. or Use the Matlab Compiler toolbox to create a standalone executable program or a dll.
  2. JockeK

    Memory problem while doing video / image analysis in Matlab

    I'm not that familiar with video grabbing but I can give you some tips... You will surely benefit from preallocating memory for your image matrices, especially if you collect images inside a loop. img = zeros(h,w,3,n); h = height, w = width and n = number of images. Explore the possibility of...
  3. JockeK

    reversing a colormap

    This should do the trick blackwhite = colormap('gray'); whiteblack = flipud(blackwhite);
  4. JockeK

    Matlab timeout problem (controlling humanoid robot)

    I had a similar problem when using a USB to serial converter. Solved it by writing asynchronously to the port. fwrite(serialObj,output,'async')
  5. JockeK

    Animation of profiles

    How about reading in the profiles from the files inside a loop, plotting it and then adding it to the movie?
  6. JockeK

    read data file

    If you had bothered to read the docs, as I suggested, you would have seen an example of the fscanf function. Where the use of the fscanf is exactly the same as in Tom's post.
  7. JockeK

    read data file

    The documentation on fscanf contains an example of this. Use doc fscanf and you'll see that fscanf(fid,'%f %f',[2 inf]); will do the trick.
  8. JockeK

    how to change tick label font size?

    Both the x and y ticklabels are set using set(gca,'FontSize',20)
  9. JockeK

    joining two strings + using pointers to the variable within strings

    First: time_and_units = [time units]; Second: (same as the first, just add one space character) label([time ' ' 'ms/div'])
  10. JockeK

    MATLAB & RS232

    I believe hexadecimal numbers are always treated as ascii by Matlab. Use the hex2dec or the hex2num function to convert. The serial port object has some events and callbacks that will help you with the data collection part. Search the help for BytesAvailableFcn, BytesAvailableFcnCount and...
  11. JockeK

    Copying a figure and everything on it

    It does copy EVERYTHING. You just need to make sure you have a handle to the things you want to copy.
  12. JockeK

    Copying a figure and everything on it

    The copyobj function will do the trick.
  13. JockeK

    How do I expand the axes to eliminate all of the gray space in a figur

    Change the Position property. set(gca, 'Position', [x y width height]) The values range from 0 to 1. Set x=0, y=0, width=1 and height=1 to completely fill the figure. However, no axis labels or tick labels will be visible.
  14. JockeK

    fliplr function

    You need to flip each color separately. img = imread('photo.jpg'); for i=1:3 % loop through R, G and B imgflp(:,:,i) = fliplr(img(:,:,i)); % flip 2-D matrix end imshow(imgflp) % show flipped image
  15. JockeK

    amplitude of fft harmonics

    Here are two good guides http://www.mathworks.com/support/tech-notes/1700/1703.html http://www.mathworks.com/support/tech-notes/1700/1702.shtml

Part and Inventory Search