Answered
I dont know where am making mistake by plot a graph using below program, please anyone can help?
Do not plot in white against a white background. % nc - is doping concentration % nc = logspace(14,20); un = (5.1e18 + 92*nc...

4 years ago | 1

Answered
Trying to use ode45 to solve a second order differential equation with time dependent parameters
tinit=0; tfinal=3.5 [t,u]=ode45(@exactanswer,[tinit,tfinal],[theta_0,thetap_0],ops,a,b); Your time range runs 0 to 3.5 in a si...

4 years ago | 0

Answered
When solving the global optimal solution with MATLAB fmincon function, is it to find several local optimal solutions and then compare them to choose the optimal solution?
fmincon() does not do that automatically. fmincon() stops at the first local minima it finds that satisfies the constraints -- b...

4 years ago | 0

| accepted

Answered
I am having trouble using lsqcurvefit with an function
Initial point is a local minimum. That is the normal output when the fitting function does the best that can possibly be done...

4 years ago | 0

Answered
Create Matrix from Multiple Matrices
A = [1 2 3]; B = [4 5 6]; C = [7 8 9]; [Ag, Bg, Cg] = ndgrid(C, B, A); D = fliplr([Ag(:), Bg(:), Cg(:)])

4 years ago | 2

Answered
How do I compare two vectors of different length without interpolation?
Is there any method where I could make the vectors the same length without interpolating? By definition: NO. Any method that gi...

4 years ago | 0

Answered
Output displaying from fprintf command via a function
When you run the function, in the command window (or in a script) enter the command E = energy; with the semi-colon. The semi-...

4 years ago | 0

Answered
Cant change directory between loops
img = fullfile(dataset(i).folder,dataset(i).name);

4 years ago | 0

| accepted

Answered
I selected the license during install but when I run it i get license manager error -83
https://www.mathworks.com/matlabcentral/answers/92385-why-do-i-receive-license-manager-error-83

4 years ago | 0

Answered
Unable to control floating point display?
round()

4 years ago | 0

Answered
rearranging bivariate equation in terms of one variable
Use isolate()

4 years ago | 0

Answered
Can someone help me to remove small region area with regionprops?
bwareafilt can be used to select areas by size

4 years ago | 0

Answered
How to do a circle with triangular mesh?
https://www.mathworks.com/help/pde/ug/generate-mesh.html Partial Differential Equations toolbox, generate mesh function.

4 years ago | 0

Answered
How to set "TightInset" globally?
You cannot control TightInset: it is read-only. You can set a default LooseInset though. set(groot, 'defaultAxesLooseInset', [...

4 years ago | 1

Answered
How to crop unwanted data from surfplot?
how do I extract a triangular section of my surf plot given certain coordinates. Simple trig. Or use polyfit() and polyval() to...

4 years ago | 0

Answered
How do I make my function's output display as an array instead of one number?
A/B with non-scalar B means approximately innerproduct(A, pinv(B)) Your x is non-scalar, so your /(x.*h) is approximately *pinv...

4 years ago | 0

Answered
Why am I getting straight lines in the each plot instead of exponential curves?
y=(log(Ri./(100-R)))'; That last value of R is 100, and 100-100 is 0, so you have a division by 0 there, giving infinity as an ...

4 years ago | 0

Answered
Optimization nonlinear function with several variable
A = []; b = []; Aeq = []; beq = []; lb = [0 0 -1]; ub = [2 1 1]; nonlcon = []; g = @(xyz) -f(xyz(1), xyz(2), xyz(3)); ...

4 years ago | 0

| accepted

Answered
Unrecognized function or variable 'predict'.
Add this to your MATLAB path function varargout = predict(varargin) if nargin == 0 msg = 'You have no input at all!...

4 years ago | 0

| accepted

Answered
How to save figures generated from function within a for loop?
savedir = fullfile('R:','Matlab Analysis','1. Processed'); if ~isfolder(savedir); mkdir(savedir); end for i=1:length(unproce...

4 years ago | 0

| accepted

Answered
Optimization solver fmincon option
THe problem is that ga() does not support the combination of integer constraints and nonlinear equality constraints. That is bec...

4 years ago | 0

Answered
Query regarding for loop
Q = @(v) sym(v); syms Edi EF1 e ea1 ev1 hbar kb Mc mde mdh NA1 ND1 T1 assume([Edi, EF1, e, ea1, ev1, hbar, kb, Mc, mde, mdh, N...

4 years ago | 0

Answered
Error: Array indices must be positive integers or logical values. / no indices in code
R_star = @(P) r * P; r is a function handle. You cannot multiply a function handle by a value. You can invoke the function ...

4 years ago | 0

| accepted

Answered
Finding the functionality for the loop
syms t N k x T = linspace(10, 1000, 100).'; y = 1 + t^2; eqn = (N + x)/(y + k) + N*x*exp(-(t)) sol_x = solve(eqn, x) sols_x...

4 years ago | 0

| accepted

Answered
How to make Matlab MEX application to be real time one on SMP general purpose multicore platform
Mathwork's only real-time product is Simulink Real-TIme (which is designed to run on Speedgoat hardware.) https://www.mathworks...

4 years ago | 0

Answered
long runtime when trying to solve a simple system
Exact solutions requires the roots of a degree 12 polynomial. syms x y; eqn = [(100*pi*(x.^2))/((((y-x)/2)+0.0022*(x.^2)-0.158...

4 years ago | 1

| accepted

Answered
double for loop errors
%part 8 m=1.24; td=10; P0=1; w_n=0:50/80:50; t=0:30/80:30; for ii=1:length(t); jj=1:length(w_n); Tn(jj)=(2*pi)....

4 years ago | 0

Answered
How to measure the length of a line in a binary image?
If you used bwmorph() to skeletonize https://www.mathworks.com/help/images/ref/bwmorph.html then assuming you do not have any ve...

4 years ago | 0

Answered
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
The variable for a for loop must be a plain unindexed variable.

4 years ago | 0

Load more