Answered
Group values of one column based of the values of another
If (x,y) are two column arrays you have. You can get values lying in between two values using: idx = x>=0.8 & X<1.4 ; y1 = y...

6 years ago | 0

| accepted

Answered
Concatenation error while defining a cell variable
col_req = {'columnA', 'ColumnB', 'ColumnC' } OR col_req = {'columnA', 'ColumnB',........ 'ColumnC' }

6 years ago | 0

| accepted

Answered
How can I get only the coefficients that are multiplied by the powers of x? Example: 5x^2 + 9x + 12y + 3z >>> [5, 9]
Read about coeffs https://in.mathworks.com/help/symbolic/coeffs.html

6 years ago | 0

Answered
Create a Matrix from different ccella array.
A{1} = rand(10,4) ; A{2} = rand(5,4) ; A{3} = rand(6,4) ; % Get length of each cell L = cellfun(@length,A) ; for i = 1...

6 years ago | 0

| accepted

Answered
Remove the edge between two stacked bars
bar(data,'stacked','EdgeAlpha',0,'EdgeColor','none');

6 years ago | 0

Answered
mean value of polynominal function
m = 1000 ; x = linspace(x1,x2,m) ; y = polyval(k,x) ; iwant = mean(y) ;

6 years ago | 0

| accepted

Answered
Doubt in the specific line
It is bad to ask such questions......asking to explain a specific line or a code. You have code in hand, play around with that. ...

6 years ago | 0

| accepted

Answered
Unrecognized function or variable 'a'.
The error is clear, you have to define a value for a. simOut = sim('TestSim23.slx'); x1 = simOut.get('i1'); x2 = simOut.get(...

6 years ago | 0

Answered
third index in three dimention array
You matrices can be 1D, 2D, 3D or nD...where D stands for dimensional. A = zeros(2,2,2) ; The above A has 2 matrices of size...

6 years ago | 0

| accepted

Answered
Generating a Legend for Colormap
Refer here: https://in.mathworks.com/matlabcentral/answers/228977-editing-colors-in-the-legend

6 years ago | 0

Answered
Is colormap have relation with mm?
The plot is obtained using surf. To plot you need (X,Y) location matrices and a matrix of values Z. The colorbar shows the distr...

6 years ago | 0

Answered
Struggling to plot a complex function using the mesh command.
Try something like this: ar = linspace(-2*pi,2*pi,10) ; [r, c] = meshgrid(ar) ; a = r+1i*c ; y = sin(a+a*pi/2) ; surf(...

6 years ago | 0

| accepted

Answered
how to remove rows from structure array on matlab
A = rand(300,1) ; idx = randperm(300,112) ; B = A(idx) ; val = ismember(A,B) ; iwant = A(~val) ;

6 years ago | 0

| accepted

Answered
How can I create a vector with constrains on Matlab?
A = ones(1,46) ; B = 2*ones(1,40) ; C = 3*ones(1,45) ; iwant = [A B C] ; N = length(iwant) ; % randomise the vector i...

6 years ago | 0

Answered
how plot same variable with different colors
Code is not attched...any ways have a look on the following. plot(x,y,'color','r') ; % specify the color If you have differe...

6 years ago | 0

Answered
Calculate RMSE error for 25x25 sections of original matrix 2100x1300
Refer this to reshape/ arrange your data as dicussed below. https://in.mathworks.com/matlabcentral/answers/362262-i-have-a-32-...

6 years ago | 0

| accepted

Answered
Reading vector elements into a string
n = [1 2] ; % your vector v = sprintf('%.0f' , n) ; % convert n to char filename = sprintf('%04d',str2num(v));

6 years ago | 0

Answered
How to add text in scatterm plot?
Read about the function text.

6 years ago | 0

Answered
How to get data points from curve?
data = importdata("Maxminpoints.txt") ; t = data(:,1) ; y = data(:,2) ; nt = 22*24 ; % number of points if every hour take...

6 years ago | 0

| accepted

Answered
Help set up averaging
https://in.mathworks.com/matlabcentral/answers/80480-how-do-i-take-the-average-of-every-n-values-in-a-vector

6 years ago | 0

Answered
geoplot(lat,lon) command error
Try: geoplot(lat,lon,'r-','LineWidth',2)

6 years ago | 0

Answered
Error with .* for cell to Scalar multiplying
OSSO{i}=uint16(I{i}).*uint16(A{i});

6 years ago | 0

Answered
how to combine strings that are generated inside a function?
function scrambled = royalscramble(str) exchange = randperm(length(str)); scrambled = str(exchange) ; end

6 years ago | 1

| accepted

Answered
How to resample long gaps in Matlab
Read about fillmissing https://in.mathworks.com/help/matlab/ref/fillmissing.html

6 years ago | 0

Answered
random selection of a cell
You got 100 columns.....you can pick any one element/ position out of it randomly using randperm. % loop for each column for ...

6 years ago | 0

| accepted

Answered
Making a contour plot from x and y data
I would follow like below: You need to generate z values which are density values. I would fix a distance r and calculate the...

6 years ago | 0

Answered
How to plot a quarter of a circle
% Radius of circle R = 1. ; % center of cricle C = [0. 0.] ; % angle th = 90:-1:0 ; % points of cricle xc = C(1)+R...

6 years ago | 0

Answered
Interpolating graphs to match
Yes very much possible. Check the below example. % Generate two random graphs with different sizes y1 = rand(1,100) ; y2 =...

6 years ago | 0

Answered
How to save the contour as a image?
Read about saveas. saveas(gcf,'myFigure.png') ; https://in.mathworks.com/help/matlab/ref/saveas.html

6 years ago | 0

| accepted

Answered
Reference to non-existent field 'i'.
Read about getfield. for i=1:length(P_list) val = getfield(S,P_list{i}) end

6 years ago | 0

Load more