Answered
plot graph for multiple values for one of the variables on the same axis (and in different colours)
You have to initilaize the variables inside the loop. Read about initliaing an array in aloop. r1=18e-2; % inner radius of s...

4 years ago | 0

| accepted

Answered
Drawing a circle with known radius
th = linspace(0,2*pi)' ; R = 1; x = R*cos(th) ; y = R*sin(th) ; % make groups G = zeros(size(th)) ; G(th >= 0 & th < ...

4 years ago | 1

| accepted

Answered
How to merge two matrix?
a=[6 6 5 6 5 6 6] ; b = [0.74 0.66 0.58 0.47 0.62 0.75 0.76] ; [c,ia,ib] = unique(a) ; N = length(c) ; G = cell(N,1)...

4 years ago | 0

| accepted

Answered
How to create a cell array by repeating a row vector
A = 1:10 ; B = reshape(repelem(A,4,1),2,2,10) ; C = num2cell(B,[1 2]) ; celldisp(C)

4 years ago | 0

Answered
Graph plotting of f(x,y)=e^x+e^y using ezsurf
clear clc syms x y f=(exp(x)+exp(y)) ezsurf(f) colormap cool

4 years ago | 0

| accepted

Answered
I want to get the result, not the graph, what to do
[f,xi] = ksdensity(x,x1);

4 years ago | 0

Answered
How to refill the Missing values to complete the sequence
Read about fillmissing. load('Values.mt') ; idx = Values == 4000 ; % get missing values i.e. 4000 Values(idx) = NaN ; % ...

4 years ago | 0

Answered
How to take monthly average from table?
Read about retime. https://in.mathworks.com/help/matlab/ref/timetable.retime.html

4 years ago | 0

Answered
How to find the closest value to the average in an array?
a = [1,2,3,4,5,6,7] ; [val,idx] = min(abs(a-mean(a))); a(idx)

4 years ago | 0

| accepted

Answered
How to stop loop rewriting
notebook = readtable('notebook.xlsx'); filename = notebook.Filename; num_files = length(filename); exp = cell(1,num_files);...

4 years ago | 0

Answered
How to find the closest value to the average in an array?
a = [1,2,3,4,5,6,7] ; idx = knnsearch(a',mean(a)) ; a(idx)

4 years ago | 0

Answered
How to make a function file that displays a polynomial and accepts a specific command?
val = lou(1,2,3,.2) function val = lou(a,b,c,x) fprintf('%dx^2 + %dx + %d =0 \n',a,b,c) val = a*x^2+b*x+c ; end

4 years ago | 0

Answered
How to remove points below a surface in matlab plot?
You can go by the z coordinate. Check the z coordinates and remove which ever points are lessthan the z value of the surface. ...

4 years ago | 0

| accepted

Answered
help ! how do i fix this error : Error using .* Integers can only be combined with integers of the same class, or scalar doubles.
Read about class. To multiply two variables, they should be of same class. a = int8(6) ; b = int16(6) ; c = int8(6) ; clas...

4 years ago | 0

Answered
Find connecting global maxima of a given dataset.
Have a look on findpeaks and envelope.

4 years ago | 0

Answered
How to plot cubic imagesc figure?
Read about slice, pcolor.

4 years ago | 0

Answered
How can I detect circles that on square edges?
I = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/963075/image.png') ; [R,C] = imfindcircles(I,[10 100...

4 years ago | 0

Answered
How to shift an array in graph x-axis with a certain value?
Add 30 to the x-values i.e. to the indices. a = 0; b = 360; rng('shuffle'); ncycles = 10; npoints = 1050000; r1 = sort((b-...

4 years ago | 0

Answered
How to plot the functions x=cos(t) and y=sin(t) in a single graph?
What you gave is a parametric equation of circle. You just need to use plot. Read about it. t=linspace(0,2*pi); x=cos(t); y=...

4 years ago | 0

| accepted

Answered
How to subset an irregular region of the earth from a global dataset using four points
REad about inpolygon.

4 years ago | 0

| accepted

Answered
Store polyfit information of for loop in matrix
You may save them into a cell as well. yp = cell(floor(length(xorg)/40)*40,1); for i = 40:40:length(xorg) for j = 1:floo...

4 years ago | 0

Answered
Extracting coordinates from an image
You can use this toolbox: https://in.mathworks.com/matlabcentral/fileexchange/7173-grabit

4 years ago | 1

| accepted

Answered
DATA Reading and Interpolation
csvFiles = dir('*.csv') ; N = length(csvFiles) ; for i = 1:N csvFile = csvFiles(i).name ; % read the file and do w...

4 years ago | 1

| accepted

Answered
creation of a histogram with RGB values (in .txt file)
data = importdata('filename.txt') ; h1 = histogram(data(:,1), 10); h1 = h1.Values ; h2 = histogram(data(:,2), 10); h2 = h2....

4 years ago | 0

Answered
find the coefficients a, b, and c of the quadratic polynomial. that passes through the three points (x, y)
% Convert the equation to form Ax = b P = [1, 4 ;4, 73; 5, 120] ; % points x = P(:,1) ; y = P(:,2) ; b = P(:,2) ; ...

4 years ago | 1

Answered
Printing rows from excel sheet based on two column values
T = readtable(myfile) ; idx = matches(T.FaceDescr,'appFace://') & matches(T.Type,'InInterests') & (T.FaceID == 258) ; T(idx,:...

4 years ago | 0

| accepted

Answered
Matlab Random Word Generator
Dictionary='dictionary.txt'; n = 5 ; % letters to pick from the string Random=randperm(length(Dictionary),5); randword = D...

4 years ago | 1

| accepted

Answered
Printing specific rows based on column from excel
T = readtable(myfile) ; idx = matches(T.FaceDescr,'all') ; T(idx,:)

4 years ago | 0

| accepted

Answered
How to find the value of x when y = 0 and label on the curve?
x = 0:0.01:66.03; y=(3.7*(10*(x/66.03).^3-15*(x/66.03).^4+6*(x/66.03).^5)-1.86); [val,idx] = min(abs(y)) ; plot(x,y,'c-','L...

4 years ago | 0

Answered
Subplot graph by combining two obtained graphs.
h1 = openfig('Flow_rate_clot_M.fig','reuse'); % open figure ax1 = gca; % get handle to axes of figure h2 = openfig('Flow_rate_...

4 years ago | 1

Load more