Answered
How to find intersection point between plot (x,aww) and plot (xt,yt)
See this FEX package: https://www.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

5 years ago | 0

Answered
Extracting Multiple X values for a certain Y value from a plot?
See this FEX package: https://www.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections. You can define a straight ...

5 years ago | 0

Answered
How do you apply FOR loop to cell arrays?
See cellfun(): https://www.mathworks.com/help/matlab/ref/cellfun.html

5 years ago | 1

| accepted

Answered
Symbolic to double or very precise
Among the natively supported datatype, double() will provide most precision. You can convert a vector from symbolic to double us...

5 years ago | 0

Answered
Adding underscore in xlabel latex interpreter
Are you looking for something like this xlabel('$L_{{(ex)}_L}$','fontweight','bold','FontSize',20,'Interpreter','latex');

5 years ago | 0

| accepted

Answered
How to output zeros from a matrix with corresponding matrix of indices for those indeces which are 0 or with negative sign ?
Something like this will work A = [ 0 -1 1 0 2 1 3 2]; B = [1 5 10]; C = zeros(size(A)); C(A>0) = B(A(A>0))

5 years ago | 2

| accepted

Answered
Unable to convert expression into double array
You are initializing I as double matrix, initialize it as a symbolic matrix syms t; I = zeros(256,256, 'like', t); for i=1:...

5 years ago | 0

| accepted

Answered
Sorting columns of a matrix without sort()
See this FEX package: https://www.mathworks.com/matlabcentral/fileexchange/45125-sorting-methods

5 years ago | 0

| accepted

Answered
plotting two legends on the same plot
It is easier to first create the lines and then make a single call to legend() p = linspace(0,1,50); v = -290*9.8*log(0.15+0.8...

5 years ago | 0

| accepted

Answered
Import data doesn't import some of the values
Have you tried readmatrix()? It seems to import the value correctly format long M = readmatrix('weighted_network.txt'); x = M...

5 years ago | 1

| accepted

Answered
Solve a Matrix equation
There might be an algebric way to solve this problem, but following shows an optimization based method rng(0); B = rand(4)+1i*...

5 years ago | 0

Answered
doubt about student license
You can install and activate it on two PC, but you are allowed to use only one of them at a time. Close it on one PC before open...

5 years ago | 1

Answered
How to find average of certain cells in a column if it's associated with another cells in another column?
You can use splitapply() A = [1, 1 2, 1 3, 2 4, 2 5, 2 6, 3 7, 3]; [grps, vals] = findg...

5 years ago | 0

Answered
How to assign value in multidimensional variable?
It will only give error if AAA is already defined. Try the following code clear AAA prod = 1; ch = 1;sub = 1; AAA(sub,prod,ch...

5 years ago | 0

| accepted

Answered
Automatically insert coefficients in surface fit
You can use fprintf() fprintf('data(x,y) = %.4f + %.4f*x + %.4f*y\n', data.p00, data.p10, data.p01)

5 years ago | 1

| accepted

Answered
Using fsolve function with binary non-linear problem
No. ga(): https://www.mathworks.com/help/gads/ga.html from Global optimization toolbox is the only solver that supports nonlinea...

5 years ago | 0

| accepted

Answered
How to set initial guess for vpasolve in a system of equations?
See the init_param in vpasolve(). Since you want to specify a bound bound for only a single variable, you can do it like this x...

5 years ago | 2

| accepted

Answered
Undefined function 'ecg' for input arguments of type 'double'.
ecg() is not a MATLAB's built-in function. You need to ask the author of the code to give you this function.

5 years ago | 1

| accepted

Answered
Rectangle wave in MATLAB App Designer
First convert the given points in the correct order for drawing a polygon x = [2, 4, 1, 3]; y = [1, 2, 4, 5]; pts = [x(:) y...

5 years ago | 0

Answered
how can i swap the matrix element using control statements or any built in functions?
You can just use sort() with reshape() D = [10 20 50 60;33 55 44 100; 3 6 12 9;4 2 1 3] E = reshape(sort(D(:), 'descend'), siz...

5 years ago | 1

| accepted

Answered
Average vector of an array
You can specify the dimension in mean() function. For example x = [0 2; 0 2; 0 2; 0 2; 0 2; 0 2];...

5 years ago | 1

Answered
MacBook Air m1
It is not supported yet. A version based on Rosetta 2 is expected to be released in December. The timeline for native support is...

5 years ago | 0

Answered
how to calculate number of unique element in array?
Try splitapply() c = [ 1 1 1 1 1 1 2 1 2 2 2 3 2 4 ...

5 years ago | 1

| accepted

Answered
How to know if a vector lies inside two vectors
Try this x_low; % lower line in red x_upper; % upper line in red y; % line in blue tf = all((x_low<=y)&(y<=x_high))

5 years ago | 0

| accepted

Answered
Undefined function or variable 'arrayDatastore'.
arraydatastore(): https://www.mathworks.com/help/matlab/ref/matlab.io.datastore.arraydatastore.html was introduced i R2020b. You...

5 years ago | 0

| accepted

Answered
Reversing the y-axis values without reversing the image.
An easy solution will be just flip the labels. Run the following line yticklabels(flip(yticklabels)) after creating the figure...

5 years ago | 0

Answered
Remove Duplicates from Cell Array
You can use unique() C; % your cell array country_names = unique(C(:,1))

5 years ago | 2

| accepted

Answered
excluding a small combinations from a combination?
Try this a=[1 2 3 4 5 6 7 8 9 10]; M = nchoosek(a,4); C = mat2cell(string(M), size(M,1), ones(size(M,2),1)); C = regexp(strc...

5 years ago | 0

Answered
how to multiple successive numbers?
You can use prod() prod(70:80)

5 years ago | 0

| accepted

Answered
How to select a specific line from text file
If the file have fixed number of header lines, then try this f = fopen('data.txt'); data = textscan(f, '%f', 'HeaderLines', 9)...

5 years ago | 0

| accepted

Load more