Answered
How I can find intersection point of direction vector and one of the given plane of 3d cube
Fairly eay to do to do with this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/30892-analyze-n-dimensional...

3 years ago | 0

| accepted

Answered
Regression line that includes x and y errors.
I would recommend linear2dFit() form this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/87584-object-orien...

3 years ago | 0

| accepted

Answered
Extract data from columns based on a range from one column.
A=readmatrix('data.xlsx'); starts=find(A(:,3)==0); stops=find(A(:,3)==99); N=numel(starts); assert(numel(stops)==N, 'Miss...

3 years ago | 0

| accepted

Answered
Help creating a Multi-Input CNN with 4D array images for Multi-Channel EEG analysis ?
I know nothing about EEG signal processing, but it seems to me that you should just view the inputs as 299x299 images with 48 ch...

3 years ago | 0

Answered
Loop for issue in me script
clear; clc; A=[1 0 0 -1 0 0; 1 0 0 0 0 0; 0 1 0 0 -1 0; 0 3 0 0 -1 -1; 0 0 1 0 0 -2; 0 -1 1 -2 0 0]; i=1; while 1 B=[...

3 years ago | 0

| accepted

Answered
How to avoid writing a for loop in A\b when A and b are different dimensions
soln=pagemldivide(A,reshape(b,[],1,Nx)); soln=soln(:,:).';

3 years ago | 1

| accepted

Answered
least square curve fitting on a nonlinear equation , set of data available
I would recommend this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/10093-fminspleas fun={@(b,x) (1-exp...

3 years ago | 0

Answered
Optimization of matrix calculations for loop & if statements
[m,n]=size(dx); dX=( dx( [m,1:m,1] , [n,1:n,1] ) ).^2; k=0.25*kappa/dz^2*[0 1 0; 1 0 1; ...

3 years ago | 1

| accepted

Answered
putting conditions on the axis intervals in fsurf
gamma=0.5; rh=linspace(0,3,200); rl=linspace(0,2,200); [Rh,Rl]=meshgrid(rh,rl); p=(gamma*Rh+ (1-gamma)*Rl)/2; p(Rh<Rl)=...

3 years ago | 0

Answered
Trouble with optimization options - equation problem example
options = optimoptions(prob); options.Display='off'; [sol,~,~] = solve(prob,C0,'Options',options);

3 years ago | 0

| accepted

Answered
How do I remove points which are far away from the boundary of domain?
Question : what can i do to remove any points which are out of the boundary nodes ? Use inpolygon to detect which points are wi...

3 years ago | 0

| accepted

Answered
how make a plot where both x and y are varying?
For example, C=(1:10)'; B=linspace(1,4,5); D=1; A=B.*C.*D plot(C,A); legend("B="+B)

3 years ago | 0

Answered
How to plot a function that has a parameter in the interval?
Using the Symbolic Math Toolbox (if you have it): syms t a=1; f=piecewise(0<t & t<a, exp(t), t>=a, 2*exp(t)); fplot(f,...

3 years ago | 0

| accepted

Answered
How to plot a function that has a parameter in the interval?
One possibility: a=1; f=@(t) exp(t).*(0<t & t<a) + 2*exp(t).*(a<=t); fplot(f,[0,2*a])

3 years ago | 0

Answered
how to solve two equation with 2 variables
You could use fsolve or fminsearch fun=@(x) [sin(x(2))+2*x(2); sin(x(1)-1)+2*(x(1)-1)]; [x,fval]=fsolve(fun,[0;0]) [x,f...

3 years ago | 0

| accepted

Answered
trust-region reflective algorithm in lsqnonlin and fmincon: same behavior for "unconstrained" optimization"?
No, they are not the same. They both take steps in a 2D subspace, but for fmincon, the basis vectors for the subspace are determ...

3 years ago | 1

| accepted

Answered
How can I find a cubic bezier curve that minimizes curvature with the Optimization framework?
It's not fminsearch's fault. The function you have created returns the same value all the time: P0 = [0, 0]; P3 = [10, 10]; %...

3 years ago | 1

| accepted

Answered
while loops and prime numbers
Can't you use isprime()? isprime(7) isprime(4)

3 years ago | 0

Answered
Is there a way to have LiveScript buttons call arbitrary functions?
This might be relevant: https://www.mathworks.com/help/matlab/creating_guis/create-simple-live-editor-task.html

3 years ago | 0

Answered
How to implement PyTorch's Linear layer in Matlab?
Another approach is to write your own custom layer for channel-wise matrix multiplication. I have attached a possible version of...

3 years ago | 0

Answered
How to implement PyTorch's Linear layer in Matlab?
Another possible way to interpret your question is that you are trying to apply pagemtimes to the input X with a non-learnable m...

3 years ago | 0

Answered
matlab plot bar problem
Are you asking how to stack the bars? If so, see this example: https://www.mathworks.com/help/matlab/ref/bar.html?searchHighlig...

3 years ago | 0

Answered
functions does not appear
You cannot create non-anonymous functions in the command window. You need to compose them in a .m file. It is recommendable that...

3 years ago | 0

Answered
Solve linear tensor equation
n=5; A=rand(n,n,2,2); utrue=rand(n,2); f=tensorprod(A,utrue,[2 4],[1 2]); A=permute(A,[1,3,2,4]); A=reshape(A,2*n,2*n); ...

3 years ago | 0

| accepted

Answered
How to implement PyTorch's Linear layer in Matlab?
One possibility might be to express the linear layer as a cascade of fullyConnectedLayer followed by a functionLayer. The funct...

3 years ago | 0

Answered
No feasible solution in optimisation in linprog
Your problem is infeasible because of the input problem data you provided, not because of coding errors. In particular, in Marke...

3 years ago | 0

| accepted

Answered
Interpolate Missing Pixels in an Image
You can use either fillmissing o regionfill. The fact that the pixel values are complex is not key. You can operate on the real ...

3 years ago | 1

| accepted

Answered
How can I change the resolution of my plots?
You can zoom in the portion of the contour plot where you want the contour labels better resolved, e.g., openfig untitled.fig

3 years ago | 0

| accepted

Answered
Inlined code segment slower than internal function pass - why?
with the inlined version merely as a result of not needing to pass the gargantuan array as an argument (and potential memory lim...

3 years ago | 0

Answered
Can't use function in summation
I would suggest not using syms, except when it is truly necessary. domain=1:150; uStep=(domain>=1); energy=cumsum(uStep./doma...

3 years ago | 0

Load more