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...
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...
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.
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...
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)...
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...
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.
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...
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 =...
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...
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...
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.
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...
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...
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 -...
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...
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...
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 http://www.mathworks.com/matlabcentral/answers/?term=AxesLayoutManager
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...
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-');
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)...
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...