Respondida
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...

más de 11 años hace | 0

Respondida
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 ...

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

Respondida
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.

más de 11 años hace | 0

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

más de 11 años hace | 0

Respondida
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.

más de 11 años hace | 0

Respondida
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(:));

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

| aceptada

Respondida
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....

más de 11 años hace | 0

| aceptada

Respondida
Accelerometer used upside down
data = -data;

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

| aceptada

Respondida
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)-...

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

Respondida
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))))

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

| aceptada

Respondida
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...

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

Respondida
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_' ...

más de 11 años hace | 0

| aceptada

Respondida
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; ...

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 0

Respondida
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...

más de 11 años hace | 10

| aceptada

Respondida
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 ...

más de 11 años hace | 0

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

más de 11 años hace | 0

| aceptada

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

más de 11 años hace | 2

| aceptada

Cargar más