Respondida
Extract numeric year from string
datestr = date; year = str2num(datestr(end-3:end));

alrededor de 11 años hace | 2

Respondida
Ability to add two variable on separate lines into a title
title({'Peaks', int2str(2015)})

alrededor de 11 años hace | 0

Respondida
How to graph a Piecewise function?
%Theta= 0:(2*pi)/100:2*pi; %the vector lists 100 elemants between 0 and 2Pi % Actually these are 101 elements; % use ...

alrededor de 11 años hace | 0

| aceptada

Respondida
How do I plot a ROC graph of True Positive vs. False Negative?
The idea of ROC analysis is to have find TP and FP for different, say, 100 thresholds, and then plot(FP, TP) where FP a...

alrededor de 11 años hace | 0

Respondida
How to merge two different size matrix logically?
Like this? A = [0, 1, 2, 3, 4, 5, 7, 10]; B = [2, 5, 7]; C(:,1) = A; C(end,2) = 0; % ind = arrayfun(@(x...

más de 11 años hace | 0

| aceptada

Respondida
Changing function logic parameters depending on outputs
You can use the istilde from http://biorobots.cwru.edu/personnel/adh/stackoverflow/04/ with the caveat that it works just in fu...

más de 11 años hace | 1

| aceptada

Respondida
Using strepp on a textfile with replacement from array.
A sketch how you could proceed: 1. Read the EXCEL file with xlsread 2. Create long array of char with the desired informat...

más de 11 años hace | 1

| aceptada

Respondida
how to choose right index
Y = Y(sum(idx, 2) ~= 2, :); plot(Y(:,1), Y(:,2), '.r')

más de 11 años hace | 0

Respondida
How can I resize the matrix?
B = A(sum(A') ~= 0, :)

más de 11 años hace | 0

| aceptada

Respondida
Adding element within vector without overwriting the existing value
X = {'asdf' 'foo' 'bar'}; n = 3; name = 'foooo'; X = {X{1:n-1} name X{n:end}};

más de 11 años hace | 0

Respondida
Index of matrices in a for loop
You compute a 3x3xN matrix where N is are the values of theta as follows QN(1,1,:) = Q11*cos(theta).^4+(2*(Q12+2*Q66))*sin(t...

más de 11 años hace | 0

| aceptada

Respondida
Is it possible to call a subfunction inside a function mscript?
No. You have to create a separate mfile that can be called by your mscript.

más de 11 años hace | 1

| aceptada

Respondida
Adjusting plot fill to show two colours depending on overestima​tion/under​estimation
Have a look at http://www.mathworks.com/matlabcentral/fileexchange/34876--greater-than--fill or my solution that does need n...

más de 11 años hace | 0

| aceptada

Respondida
choose elements from array
To compute a cellarray 'combinations' with all 2^N possible combinations of elements, you can use: val = 1:3; N = numel(...

más de 11 años hace | 0

| aceptada

Respondida
Set new position for x label at semilogx diagram
semilogx(Tr(2:end),SSa,'g*-') hold on semilogx(Tr(2:end),SSb,'b*-') semilogx(Tr(2:end),SSc,'r*-') set(gca, 'XTick'...

más de 11 años hace | 0

Respondida
how can i find t closest image in many images?
Well, there is lots of research devoted to this question. One simple way would be to compute the RMS (root mean squared) differe...

más de 11 años hace | 0

Respondida
How to read datafiles residing in a different path than the program using the 'load' command or otherwise?
srcdir = 'F:/TP/Data/day' for i = 1:10 fullfilename = [srcdir filesep 'datafile_' int2str(i) '.dat']; %...

más de 11 años hace | 0

Respondida
Speeding up matrix multiplication and inversion
If the matrices are sparse, coding them as such using Msparse = sparse(M); may help.

más de 11 años hace | 0

Respondida
finding number of pixels inside each circle
A well-known "approximation" is :-) N = round(radius^2*pi) You could also create a circle and count the pixels: rad...

más de 11 años hace | 1

Respondida
Matlab help. How to add a file into matlab?
The quick way is to find out current directory (the Present Working Directory) pwd and copy the file to this folder. ...

más de 11 años hace | 3

| aceptada

Respondida
mapping of matrices with different size
Stephen made some remarks that are useful in general, but in your case you can get along with newdata(:,1) = 0:0.1:1; % fir...

más de 11 años hace | 0

Respondida
How to extract residuals from a best fit
The is no space between adjust and the following number in your Locator Repeatability 131 No Coolant.txt file, resulting in Adju...

más de 11 años hace | 0

| aceptada

Respondida
Finding the value of a line when it falls past a certain value on the y axis
First, don't use "length" as a variable, it's a function in Matlab. I used L instead. In general there will be no value in L ...

más de 11 años hace | 0

Respondida
plot smooth curve through discreet points
First you have to interpolate x depending on y. Next, you have to do the interpolation separately for each of the discontinuous ...

más de 11 años hace | 1

| aceptada

Respondida
How to use negative numbers in MatLab
Use grades(grades < - 1.5) = -3;

más de 11 años hace | 1

Respondida
How to concatenate string vectors of unequal length?
v1 = {'a' 'b' 'c'}'; v2 = {'d'}'; v3 = {'e' 'f'}'; m = max([numel(v1) numel(v2) numel(v3)]); if numel(v1) < m, v1{m} =...

más de 11 años hace | 1

Respondida
Can I restore the original matrix back from its gray scale image?
If you have normalized the values there is no way back to the original values, because if a matrix M results in image I when nor...

más de 11 años hace | 0

| aceptada

Respondida
determining number of inputs
N = ('How many times?'); for i=1:N a(i) = ('your input'); end

más de 11 años hace | 0

| aceptada

Respondida
integration of FFT
The is no such function as int in Matlab. What is int supposed to do?

más de 11 años hace | 1

Respondida
Superimpose matrices of different sizes
This works only if A and B have the same number of rows: ind = find(B>0); C = A; C(ind) = B(ind);

más de 11 años hace | 0

Cargar más