Answered
How to have an empty space in a vector for operations
I would like to have a vector with an blank space, not a NaN, simply a blank space. There is no such thing as a "blank space" ...

4 years ago | 0

| accepted

Answered
Best fitting curve for variable data
Using fminspleas from the File Exchange https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas % data x = [1...

4 years ago | 1

| accepted

Answered
Creating Dummy Variable without dummyvar
function res = create_Dummies(x) %create dummy variables for a given vector of values res=x(:)==unique(x)'; end

4 years ago | 1

| accepted

Answered
How can I separate objects with one pixel connected after bwlabel
load BW L=watershed(-bwdist(~BW)); BW=BW&L~=0; imshow(BW)

4 years ago | 1

Answered
access elements of vector within struct
S.A doesn't appear to be playing any role within your loop at all. You could just as easily have done, temp = nan(1,100); %pre...

4 years ago | 0

Answered
Limit on no. of data points
No, there is no limit.

4 years ago | 0

Answered
How to create an overall legend for subplots with the SUBAXIS function?
x = -10:10; city = {'London', 'Paris', 'Berlin','Madrid'}; season = {'summer','winter'}; colors = {'blue','red','black','mag...

4 years ago | 0

| accepted

Answered
How to use blockproc for selecting a few pixels of each block of image?
I recommend instead donwloading mat2tiles https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-int...

4 years ago | 1

| accepted

Answered
why is the rank of a matrix is different from the rank of its Reduced Row Echelon Form
Generally speaking it is because doing rref introduces floating point errors that perturb the SVD, from which the rank is calcu...

4 years ago | 0

| accepted

Answered
GA optimization: presenting bounds as linear constraints
Yes, that's to be expected. Because a region specified by bounds has explicit boundaries, GA can select an initial population co...

4 years ago | 0

Answered
Taking the fft of a signal sampled above the Nyquist rate but getting strange results
nfft = 2^nextpow2(length(xt)); df = 1/nfft/dt; freq = df*(0:nfft-1); xf = abs(fft(xt,nfft))*dt; half=1:nfft/2; pl...

4 years ago | 0

Answered
Maximum Value of every pixel in a cell array with 428 pictures.
maximum_image=-inf; for i=1:428 maximum_image=max( maximum_image , imgb{1,i,:,:}); end

4 years ago | 0

| accepted

Answered
How to get train accuracy and loss data during CNN training process? (image classification).
The info output should contain that. [net,info] = trainNetwork(___)

4 years ago | 1

| accepted

Answered
Maximum Value of every pixel in a cell array with 428 pictures.
maximum_image=squeeze( max( cell2mat(imgb),[],2) );

4 years ago | 0

Answered
How do I make a script to show the field names of struct in a struct
Something like this? a1='abcd'; a2=[1 2 3]; s.a=char(a1,a2); s.b.a = ones(3); s.b.b = eye(4); s.c.c = magic(5); s.d=cha...

4 years ago | 0

| accepted

Answered
How to make 3 bar subplots have the same scale?
axis( findobj(gcf,'Type','axes'), [xmin, xmax,ymin,ymax])

4 years ago | 0

Answered
How to get nan as output if the function output argument is not supported?
if logical_out == 0 [run_time, reaction_time]=deal(nan); return end

4 years ago | 0

Answered
Putting alpha in a string
Note the double slash in '\\alpha' as well as Interpreter='tex'. str=sprintf('B-H Curve at Frequency=%d for M{_s}=%.2f, \\alpha...

4 years ago | 1

| accepted

Answered
Create a matrix where every row adds to a number and within the matrix represents every possibility of the row combinations
See attached. n=4;k=3; diophantine(ones(1,n),k,0:k)

4 years ago | 1

| accepted

Answered
Indexing inside a function
This might be what you want, A = 10.493056201500981; B = 1.663772278341260e+03; x0 = [A,B]; TemperatureKelvin = 273+[101.5...

4 years ago | 1

| accepted

Answered
Create an array containing indeces and value
I need to the cross correlate the "combined" vectors with another vector. I don't know how to do it if they are separated. xc...

4 years ago | 0

Answered
Unexpected eigenvectors for circulant matrix
It looks like your matrices have some eigenvalues with multiplicity greater than 1. The eigenvectors are therefore not unique.

4 years ago | 1

| accepted

Answered
Fit a least squares ellipse
I feel like i have everything correct (i might not have) Your ordinary least squares method is not ideal because your design m...

4 years ago | 0

Answered
How to vectorize nested for loops within a script
You cannot vectorize loops over cells and structs. In most cases, cells and structs are appropriate only for small data sizes (w...

4 years ago | 0

Answered
How to take the absolute value for 2D spectrum?
spectra=abs(spectra)

4 years ago | 0

Answered
How do I draw an ellipsoid with given axes and radiuses
One option is to download this, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-oriented-tools-for-fitting-co...

4 years ago | 1

| accepted

Answered
Calculate and plot the shortest distance (norm) between a point and a line in 3D space
A=A(:); B=B(:); P=P(:); %column vectors C=A + (B-A)\(P-A)*(B-A); %nearest point xyz=num2cell([P,C],2); line(xyz{:})

4 years ago | 0

| accepted

Answered
Setting elements of an array to be zero based on the values of a vector
A = [1 0 0; 0 1 1; 1 1 0] B = [1 3 5]; [I,J,S]=find(A); tf=~(ismember(I,B)|ismember(J,B)); %set these to zero A=accuma...

4 years ago | 0

Answered
Setting elements of an array to be zero based on the values of a vector
A = [1 0 0; 0 1 1; 1 1 0] B = [1 3 5]; [m,n]=size(A); I=B(B<=m); J=B(B<=n); A(I,:)=0; A(:,J)=0

4 years ago | 0

Answered
How to display structs only in a struct with fields?
t='11'; s.q=1; S=struct('a',t,'b',s,'c',s,'d',[s,s]) p=reshape( namedargs2cell(S) , 2,[]); keep=structfun(@(f)isstruct(f)...

4 years ago | 0

Load more