Answered
User input bar graph
If you store your budget for each year you just need a single call of bar years = input('How many years? '); for curyear...

11 years ago | 0

Answered
Split cell array taking into account difference between elements
This is somewhat similar to Star Strider's solution but with an extra index ind_new to get rid of the subarrays and with a copy ...

11 years ago | 0

Answered
code to do iterations on matlab
p1=400 p2=300 p3=150 for i=1:9 % place your code here end

11 years ago | 0

| accepted

Answered
Errorbar: Thicker line but same error bar width
Just plot a thicker line on top: hold on plot(x, jobsInSystem, '-k.', 'LineWidth', 2)

11 years ago | 0

| accepted

Answered
calculate an equation with index
x = 0:N-1; kon = sum(x.^2);

11 years ago | 0

Answered
textscan: skipping rows with missing data
I think that you have to read individual lines with fgets and then deal with the cases of missing values.

11 years ago | 0

Answered
Help with building an Iteration function
You have to call your function with one input, e.g. iteration(20)

11 years ago | 0

Answered
How can I get the (approximate) eigenvectors of a huge matrix?
If M contains many 0's you can define M as a sparse matrix to speed up computation.

11 years ago | 0

Answered
Function: var,mean,std how to use on the matrix?
Use : to convert your matrix to a vector and then use mean, var, etc: m = mean(V(:));

11 years ago | 0

| accepted

Answered
Help generating plot of Zakharov's function
x = -5:0.1:5; y = x; for i = 1:numel(x), for j=1:numel(y), Z(j,i) = zakh([x(i) y(j)]); end; end [X Y] = meshgrid(x, y); s...

11 years ago | 0

| accepted

Answered
minboundcircle stuck in infinate loop of a particular dataset
I cannot replicate your error but get minboundcircle(X89,Y89) ans = 471.8077 261.8077

11 years ago | 0

| accepted

Answered
how to convert RGB to YIQ color space ?
Hi Namita, there is a function on File Exchange that does a lot of color conversions that might be useful for you http://www....

11 years ago | 0

| accepted

Answered
Accelerometer used upside down
data = -data;

11 years ago | 0

| accepted

Answered
Choose data and plot from a 3x5 Matrix
Database is not a 3 x 5 matrix but a cell array with 3 x 5 elements. So your ii should probably run like this: for ii = 1:nu...

11 years ago | 0

| accepted

Answered
how can i save the output of the loop
filename = sprintf('file%d', i); save(filename)

11 years ago | 0

| accepted

Answered
Simpler way without for loops
sz = size(Mat_A_3D); ind = sub2ind(sz(1:2), idx(:,1), idx(:, 2)); offset = repmat(cumsum(repmat(prod(sz(1:2)), [1 sz(3)-...

11 years ago | 0

Answered
how to convert RGB to YUV ?
http://www.mathworks.com/matlabcentral/fileexchange/20033-firewire-vision-tools/content/web_CMU1394_VisionTools/_bin/rgb2yuv.m ...

11 years ago | 0

| accepted

Answered
Find the higher frequency for nearest value in column
[X1 X2] = meshgrid(x, x'); D = sqrt((X1 - X2).^2); x_closedtoall = X1(1, find(sum(D) == min(sum(D))))

11 years ago | 0

| accepted

Answered
In an assignment A(I) = B, the number of elements in B and I must be the same.
Your function f returns a 2x1 column vector that cannot be assigned to a scalar mol_frac(i); instead, use mol_frac(:,i)= fso...

11 years ago | 0

| accepted

Answered
Percentage from two text file and send to axes in GUI.
Read the text files. Make sure you have the right names (you provide files test2.txt and test3.txt but use different files testa...

11 years ago | 0

Answered
How to display data after one iteration step
Put a figure command and the command to show your image into your for loop.

11 years ago | 0

| accepted

Answered
image intensity scale sub-divide into two ranges
h1 = hist(I(I<=127), 0:127); h2 = hist(I(I>=128), 128:255);

11 years ago | 0

Answered
What is the correct syntax for num2str
set = [0.4 0.204 0.242]; manoev = 1:5; for i = 1:numel(set) for j = 1:numel(manoev) filename = ['Dataset_' ...

11 years ago | 0

| accepted

Answered
regroupe the results in a matrix
Ok, here is my 2nd solution. There's also a faster way to compute f, I think: f = 1 - (mod(sum(A'), 2) == 1); x = 0:7; ...

11 years ago | 0

| accepted

Answered
regroupe the results in a matrix
x = f(:,2); x(logical(f(:,1))) ans = 0 3 5 6 x(~logical(f(:,1))) a...

11 years ago | 0

Answered
How to parse information between two strings using regular expressions?
help regexp There it says Characters that are not special metacharacters are all treated literally in a match. To ma...

11 years ago | 0

Answered
How to do a boxplot for three samples of different sizes?
x1 = randn(600,1); x2 = randn(1440,1); x3 = randn(500, 1); x = [x1; x2; x3]; g = [zeros(length(x1), 1); ones(lengt...

11 years ago | 10

| accepted

Answered
Parfor variable slicing and assignment
Probably Matlab simply is not smart enough to figure out that in your particular example the size of A is fixed. Without having ...

11 years ago | 0

Answered
How to process min and max data on a graph
Have a look at function errorbar

11 years ago | 0

| accepted

Answered
estimation/measure of entropy
Make sure you run log2 only on values > 0. Otherwise you would get NaN. I = im2double(rgb2gray(imread('peppers.png'))); ...

11 years ago | 2

| accepted

Load more