Respondida
Problem with Create Matrix
Because Error using vertcat CAT arguments dimensions are not consistent. You have 10 numbers in the first row, and try...

más de 10 años hace | 0

| aceptada

Respondida
Array of Struct: Index exceeds matrix dimensions
Maybe you defined datevec as a variable? Please check using which datevec And does s always contain 106 elements? To mak...

más de 10 años hace | 1

Respondida
Store the structure fields generated in a for loop into a vector
Use a cell array: RPM{i} = ord.rpm;

más de 10 años hace | 0

| aceptada

Respondida
How many neurons in the hidden layer???
There are only rules of thumb on how to do this, I think. http://stackoverflow.com/questions/3345079/estimating-the-number...

más de 10 años hace | 0

Respondida
Programming course - question help
Define your function with an output argument function s = generationXYZ(n) and assign this in your function if 0 <=...

más de 10 años hace | 0

Respondida
How do I pass the output of a command as argument to the other command?
You have to use eval: eval(['size(' sprintf('%s%d','elem_append_mod',6) ', 2)' ]) BTW: If you use a fixed constant like ...

más de 10 años hace | 0

| aceptada

Respondida
Writing secret codes?
Let's work it out first for a single letter. The base idea of this encryption is to just add a constant offset, the 'key' to ...

más de 10 años hace | 0

Respondida
Importing text to cell, avoid conversion to scientific notation
You can use dlmread for this task.

más de 10 años hace | 0

Respondida
Comparing more than two columns of a matrix using '<' or '>' symbol
A = [2 5 4 4 1 2 6 0 1 7 5 8]; pairs = nchoosek(1:size(A,2), 2) X = cell...

más de 10 años hace | 0

Respondida
How do I define a variable I just made with an IF statement?
It's a typo in the 4th line, remove the > and use x2 = x1.*2 Note that if x1 is not <= 0, it must be > 0 , so you there ...

más de 10 años hace | 0

| aceptada

Respondida
Find Diverging point of two arrays
I loaded your data and found that if y is the data of the higher curve, you can find the diverging point using dp = find([...

más de 10 años hace | 0

Respondida
Imaginary part of a function while real part is positive
F = log(Z.^0.5); contour(imag(F).*(real(F)>0))

más de 10 años hace | 0

Respondida
Shuffling elements within the rows of a matrix
To achieve the last step in your code, use sub2ind: B = A(sub2ind([nr nc], ri, col_indx_mtrx));

más de 10 años hace | 1

Respondida
How to count after how many iterations my program reached min/max of unimodal function
You have to change the while expression, because a will never become exactly 0.846 while abs(a - 0.846) > 1e-3 and use p...

más de 10 años hace | 0

Respondida
Can't find MEXOPTS.BAT file
It is located in [matlabroot filesep 'bin'] Note that it is called mexopts.sh on MacOS and Linux.

más de 10 años hace | 0

Respondida
I need to normalize a vector size 82x1
x = randn(82,1); x = (x - min(x))/(max(x)-min(x));

más de 10 años hace | 0

Respondida
How can I make a flat,horizontal line appear in Matlab when my values are less than zero?
function h = height(t) h = ((-9.8).*(2.^(-1))).*(t (:) .^2) + 125.*t(:) + 500; h(h<0) = 0; end

más de 10 años hace | 1

Respondida
Changing switch statement to while loop?
You can use the menu in the while loop as follows: while menu('Information Correct?','Yes','No') == 2 wrong = menu('Wha...

más de 10 años hace | 0

| aceptada

Respondida
Creating character codes from text file
Set up code table X chars = ['A':'Z' 'a':'z']; for i = 1:numel(chars) X{chars(i)} = sprintf('c%02d', i); end d...

más de 10 años hace | 0

| aceptada

Respondida
Plotting two different data sets on one graph
The range of the first graph is 0 to about 900, and 674.981 to 674.982 for the second graph. So the second graph would be a hori...

más de 10 años hace | 0

| aceptada

Respondida
ca someone please help me with this . i get not enough input argument.
You have to call the function with two arguments. y = rand(500,1); A = rand(500, 500); f(y, A); Note that it would be...

más de 10 años hace | 0

Respondida
How can I crop an object in an image without actually knowing where in the image the object is located?
I = imread('ButtsB.jpg'); Convert to binary (for example, using R layer of image and threshold 100): B = I(:,:,1) > 10...

más de 10 años hace | 0

| aceptada

Respondida
Add multiple images from one tiff file to one image
Outside the loop, set E = []; In the loop, use D = E + im2double(imread(fname, 'Index', k)); Note that you cannot...

más de 10 años hace | 1

Respondida
Apply a skew normal distribution to a normal distribution
gaussian = @(x) (1/sqrt((2*pi))*exp(-x.^2/2)) skewedgaussian = @(x,alpha) 2*gaussian(x).*normcdf(alpha*x) plot(x, gaussi...

más de 10 años hace | 13

| aceptada

Respondida
How to calculate the inter-band average image.
If you have your RGB image in a MxNx3 matrix, you can use I = im2double(imread('peppers.png')); % sample image % make s...

más de 10 años hace | 1

| aceptada

Respondida
how to plot by looping
The points are not visible because plot(xa6(s6),ya6(s6),'-'); just plots a single point that falls on the axis or the grid lines...

más de 10 años hace | 0

| aceptada

Respondida
error: not enough input arguments
You have to call the function with an argument, like satur(23)

más de 10 años hace | 0

Respondida
Subscript indices must either be real positive integers or logicals.
for f=1:0.2:20; and in the loop p(f) = , so you try to eval p(0.2) = ... which is not allowed. f=0.2 is used as a subscript inde...

más de 10 años hace | 0

Respondida
Find row and collumnumber in matrix.
This finds cells that contain a 1, maybe amongst other numbers: find(cell2mat(cellfun(@(x) (any(x==1)), C, 'UniformOutput', ...

más de 10 años hace | 0

| aceptada

Respondida
How to replace elements in a vector?
First determine the indices of the 2's and 3's, then replace them: idx2 = v == 2; idx3 = v == 3; v(idx2) = 3; v(idx3) ...

más de 10 años hace | 0

Cargar más