parallel computation for a for loop
parfor pi=1:NP*kkk Tempo1 = zeros( p(pi) ,1 ); Tempo1_M = zeros( p(pi) ,1); Tempo2 = zeros(q(pi) ...

3 years ago | 0

| accepted

How to Hybrid two median filters
out = medfilt2(medfilt2(yourImage))

3 years ago | 1

fitting a funciton with minimax error
Consider using fminimax.

3 years ago | 1

Error using trainNetwork. Unable to read file.
I think it is expecting more traditional types of image files like .jpg,.png, etc.. I think for .mat you need to specify a speci...

3 years ago | 0

| accepted

How to use a for-loop to find the onset (first element) of trials of zeros, ones and twos, in an array of sequences of zeros, ones and twos
No, we're not going to do your homework for you. Go away and leave us alone.

3 years ago | 1

Rotation of the circle (points)
Just add an increment to the th th = linspace(0,2*pi,10) + rotation_angle ;

3 years ago | 0

| accepted

Multiply and shift ?
R = ifftshift(xcorr(x,'unbiased'))

3 years ago | 1

FFT Peak at Zero
Apply fftshift to your spectrum to see it with DC centered in the plot. x=csvread('230.csv',1,0); rollSpectrum=ffts...

3 years ago | 2

Solving compound linear optimization problem
I've never heard of a compound optimization problem but maybe this will help https://www.mathworks.com/discovery/multiobjective...

3 years ago | 1

Question

Is this a bug in lsqcurvefit?
When I run this simple test of lsqcurvefit (this is R2018a), I get errors. opts=optimoptions(@lsqcurvefit,'SpecifyObjective...

3 years ago | 0 answers | 1

0

invalid syntax at '=' . A '(' might be missing a closing ')'
if (f == 0) and same thing in this line if(~isinteger(NMAX) || NMAX == 0 || ischar(NMAX))

3 years ago | 0

| accepted

How to save vectors with different lengths
One way is to use cell arrays C={1,[2,3],[4,5,6,7]}

3 years ago | 0

fitting 2 variable function to (x-1) form
My fit is completey messed up, and it looks nothing like the data. It shouldn't look like the r and eta data, because that's no...

3 years ago | 1

| accepted

Image registration of two different imaging moralities
That sounds like a very unusual registration problem, but if you have a model that relates the CT image to the microscopy image,...

3 years ago | 0

How to preprocess this image.?
PI=I; PI(~CH_objects)=255; imshow(PI); title('Preprocessed Image');

3 years ago | 0

| accepted

how to extract the first three elements present in each row of a matrix
B=A(:,1:3)

3 years ago | 0

| accepted

max min optimization using inbuilt MATLAB function fminimax
The outside negative sign only matters if you care about calculating the optimal fval [x,fval] = fminimax(------) fval=-fval; ...

3 years ago | 1

Unable to perform assignment because the left and right sides have a different number of elements.
k(i) = (4/pi) * (1/(2*i+1)) * sin( ((2*i+1)* pi.* t(i))/T );

3 years ago | 1

| accepted

Fit multiple sets of data with same function model to get optimal global parameter using lsqcurvefit

3 years ago | 0

| accepted

Not Enough Input Arguments in fsolve
function myProblem options = optimset('display','off') x = fsolve(@fun,[2 3.5],options) X = x(1) Y = x(2) fun...

3 years ago | 0

| accepted

My textbook gave me code that has an error I don't know how to fix
alt and flag must be scalars.

3 years ago | 0

| accepted

Reducing a vector size when it is being updated in a loop
for h=5:-1:1 %code to load all script files if h==1 A = dlmread("Trial 1"); elseif h==2...

3 years ago | 1

| accepted

How can I go back to the beginning of my program first line by a command?
keepGoing=true; while keepGoing answer=input('Do you wish to continue [yes/no]','s'); keepGoing=(answer=...

3 years ago | 0

Classdef get methods: allowing get indexing into an array of length either (1x1) or (Nx1).
You would need to overload subsref, e.g., methods function out=subsref(obj,S) if S(1).type=="." && S(1).subs{1}=="A" &&...

3 years ago | 0

| accepted

(x²+y²+z²)dx-(2xy)dy-(2xz)dz=0
Easy. x=0; y=0; z=0;

3 years ago | 1

Help with fmincon function
First of all, let's fix your code. g = @(u) 30*u(1) + (20/2)*(u(2))^2 + (20/2)*(u(3))^2 + (10/2)*(u(4))^2 + (40/2)*(u(5))^2; ...

3 years ago | 1

| accepted

Why dir function is creating additional files while creating a structure? how to ignore it?
Do a more specific search, like files = dir('folder/*.jpg'); Or, just throw the first 2 away files = dir('folder'); files(1:...

3 years ago | 0

| accepted