Search results

  1. Image Analyst

    MATLAB Matlab command question: length max([x+y-1,x,y])

    When you use length without parentheses, it assumes that everything after it is a string, so length max([2+3-1,2,3]) is really the same as length 'max([2+3-1,2,3])' and the string 'max([2+3-1,2,3])' is 16 characters long. If you would have used parentheses, it would not make the...
  2. Image Analyst

    MATLAB MATLAB degrades image quality

    Try export_fig by Yair Altman, on the File Exchange, or maybe try the truesize() function.
  3. Image Analyst

    MATLAB MATLAB degrades image quality

    Don't save your output image (with all the axes, graphics, labels, titles, etc.) as JPG format. Yes, that will give you a crappy image. Save the image as PNG format, which is lossless compression and will give you exactly what you see. Be sure to maximize your screen first so your output...
  4. Image Analyst

    MATLAB Why is this Java code not working?

    If you want it in MATLAB, why not write it in MATLAB language (instead of Java)? I didn't even know MATLAB could run Java. And we're still not sure what "not working" means to you. Please elaborate.
  5. Image Analyst

    MATLAB Best fit line for data points

    Or perhaps you should upgrade your computer.
  6. Image Analyst

    MATLAB Help needed to fix a matlab code

    If you put braces around an expression, it turns it into a special kind of variable called a cell array. A cell array is not a numerical variable - it's a container for variables. You can't divide a number (1) by a container. See the FAQ to gain a better, more intuitive understanding of what...
  7. Image Analyst

    MATLAB Matlab's plot command

    It's not a bug. And the order doesn't matter. The problem is you don't have a dash in there. It's some character that looks like a dash but isn't. When I paste in your code it shows the error message Error using plot Error in color/linetype argument. Error in test1 (line 3)...
  8. Image Analyst

    MATLAB Definition of prompt

    The command window is the whole window, which includes the >> prompt, any commands you type in at the prompt, and any results that get echoed into the window. It's essentially the whole white rectangular box. The command prompt is the >> symbol you see inside the command window, and is where...
  9. Image Analyst

    MATLAB Matlab -- how to make a smooth contour plot?

    Try using interp2() or griddedInterpolant() to make more data point locations before passing the image to contourf().
  10. Image Analyst

    Personal/home editions

    The home version of MATLAB is the same software as the full professional version, so if you're familiar with MATLAB, it's the same. It's not a crippled, dumbed down, or limited capability version. The only thing different is the license and the cost.
  11. Image Analyst

    MATLAB Highlight an object in an image?

    Well I know a little bit about image analysis, having done it full time for the last 37 years. You have to define what food is. How would the computer know that the red stripes on the table cloth are stripes and not licorice ropes? How would it know that the chopsticks are not breadsticks or...
  12. Image Analyst

    GrayScott Model

    Mike's blog gives the code. Why not just use his code?
  13. Image Analyst

    MATLAB How to spin the colormap in 2 different circles in matlab

    Have you tried using circshift() on the colormap?
  14. Image Analyst

    MATLAB Working out an equation on MATLAB using co-ordinates

    Saints-94, you can do fprintf('y = %f * x^2 + %f * x + %f\n', coefficients(1), coefficients(2), coefficients(3));
  15. Image Analyst

    MATLAB Working out an equation on MATLAB using co-ordinates

    Try this: % Initialization steps. clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all existing variables. Or clearvars if you want. workspace; % Make sure the workspace panel is showing. format long g; format compact; fontSize =...
  16. Image Analyst

    MATLAB Does MatLab have this kind of function?

    There are several variable types you could use. There is a cell array. A cell array is like an array of buckets. You can put anything you want into any bucket. And all buckets in a row or column of buckets don't need to have the same type or size of stuff in them. A related variable that...
  17. Image Analyst

    MATLAB Plotting graph 3D minimization

    How is this a 3D graph? You have y as a function of a single variable, x. That makes it a 1-D relationship which can be plotted with a regular function like plot(). Now, I've never used fminbnd() nor wei(). When you run this, is y a 3D array, with 3 indexes instead of only 1? What does...
  18. Image Analyst

    MATLAB How to extract data from existing JPEG/TiFF graph?

    You can use getframe() plot(1:10); structFrame = getframe(); % Get structure rgbImage = structFrame.cdata; figure; imshow(rgbImage);
  19. Image Analyst

    MATLAB Problem with Generating Barnsley Fern Fractal in MATLAB

    How can I copy your code to MATLAB? When I simply copied and pasted, it put your whole program as one single line in MATLAB, then added a URL reference link below it.
  20. Image Analyst

    How do I extract elements of a random matrix masked by a circle with its center at A(15,26)

    Try this: % Demo to mask an array with a circle. clc; % Clear the command window. close all; % Close all figures (except those of imtool.) imtool close all; % Close all imtool figures. clear; % Erase all existing variables. workspace; % Make sure the workspace panel is showing. fontSize...
  21. Image Analyst

    MATLAB What is wrong with this WHILE loop?

    Not sure what conditions you want to run the loop or quit the loop, but perhaps this commented code will explain some things: % Initialize some values a = 5; b = 0.5; % This following loop will execute forever % because b is less than 1. % It doesn't matter at all what a is % because the b...
  22. Image Analyst

    LaTeX Placing greyscale .jpg images into a matrix

    Larry, there is an uncompressed jpeg option. The format is jpeg2000 with an extension of j2k. Type imformats on the command line to see what formats your version of MATLAB can read in. To see if it's compressed, see what numel(rgbImage) is - that's how many pixels in all color channels -...
  23. Image Analyst

    LaTeX Placing greyscale .jpg images into a matrix

    I have a hyperspectral app that uses 30 wavelength PNG images. Using a 3D image is fine - just depends on what you want to do and how you want to do it. Or you might just process the images one image at a time without building a 3-D image in advance. You should use imread(), not Tiff() if...
  24. Image Analyst

    MATLAB How to use matlab for imaging?

    I'm not sure what help you need. Do you have a data file? Have you read the data from the file into a variable in MATLAB? Do you have the variable but just don't know how to apply your equation(s) to it? Do you not know how to turn the results of the equation into a 2-D or 3-D array that...
  25. Image Analyst

    MATLAB Persistent plot legend error in recent install of R2015b

    Try the command opengl software If that doesn't work, try searching the MATLAB Answers forum for various terms in your error message, for example
  26. Image Analyst

    MATLAB Second Derivative in Matlab

    You can implement this method with conv(), though with such a small array as the poster posted, the edge effects will reduce the valid region to about one element. However, for a longer vector (more elements), conv() is a good way to take the numerical/empirical derivative (vs. the analytical...
  27. Image Analyst

    MATLAB Second Derivative in Matlab

    What does that mean? I showed you how to calculate the second derivative of r with respect to x. Is that not what you want? Is r the independent variable instead of x? If so, just swap x and r in my code. Or do you just need to know how to call plot()??? plot(xFit, deriv2, 'b-');
  28. Image Analyst

    MATLAB Second Derivative in Matlab

    How about fitting it to a curve, then calculating the second derivative analytically from the fitted curve formula? Like this: x=[0.1;0.07;0.05;0.03;0]; r=[-98.9407;-105.7183;-111.2423;-116.0320;-120.0462]; plot(x, r, 'r*-', 'LineWidth', 2); % Fit to a cubic coefficients = polyfit(x, r, 4)...
  29. Image Analyst

    MATLAB Persistent plot legend error in recent install of R2015b

    Why is that not an option? You can always call restoredefaultpath and then just set your custom path afterwards.
  30. Image Analyst

    MATLAB Interpolating a zoomed in colorscale image in Matlab

    You could cast it to uin8 but you don't need to if you don't want to. You can use colormaps with floating point arrays. Just use imshow(yourDoubleArray, []); colormap(jet(256)); % Or whatever colormap you want colorbar; You can mess around with caxis() if you want to apply the colormap to...