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

mehr als 11 Jahre vor | 2

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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}};

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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(...

mehr als 11 Jahre vor | 0

| akzeptiert

Beantwortet
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'...

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

Beantwortet
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']; %...

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 3

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

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

mehr als 11 Jahre vor | 1

| akzeptiert

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

mehr als 11 Jahre vor | 1

Beantwortet
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} =...

mehr als 11 Jahre vor | 1

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 0

| akzeptiert

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

mehr als 11 Jahre vor | 1

Beantwortet
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);

mehr als 11 Jahre vor | 0

Mehr laden