Answered
how can i solve quadratic equation to find elements of matrix
syms a b c d eqn = a == -b/(c*d - b^2) ; solve(eqn,b) Now you have the formula (this could be achieved with hand calculation...

5 years ago | 0

| accepted

Answered
knnsearch but with a constraint
You can specify the number of points you want from knnsearch. Get as many number of points you want. After calculate the angle a...

5 years ago | 1

Answered
Reshaping the first row of a matrix as the first elements a column
A = rand(11,3); A = A' ; A(:)'

5 years ago | 0

Answered
GEO-MAPPING OF UNITS BY EU-NUTS SHAPE FILE
Load the shape files using function shaperead. Read about this function. You can get nearest locations using knnsearch. Read a...

5 years ago | 0

Answered
Restrict x values while plotting the pdf function
mu2=3; sigma2=2; X2=normrnd(mu2,sigma2,[200,1]); sorted_X2=sort(X2); Y2=normpdf(sorted_X2,mu2,sigma2); figure hold on plo...

5 years ago | 0

| accepted

Answered
filter data in matrix
Let A be your matrix of size m*2. idx = A(:,1)<100 ; % get logical indices in first column less than 100 A(idx,:) = [] ; %...

5 years ago | 0

| accepted

Answered
How do I make numbers shift using a while loop while keeping the last itteration?
A = 1:5 ; % example array for n = 1:5 % loop for shifting B = circshift(A,n) ; % for comapring the answer use inbui...

5 years ago | 0

Answered
How to change the resolution of a data?
Read about meshgrid and interp2. With meshgrid you define your required resolution grid. And using interp2 you can get the dat...

5 years ago | 1

| accepted

Answered
Import excel sheet column to drop down component fields
You can load the excel file using readtable. This will give you a table with column names as the naems given in excel file. T ...

5 years ago | 0

| accepted

Answered
how to filter particular set of dates from a column?
Convert the dates to datenum and use logical indexing i.e. use inequalitties.

5 years ago | 0

| accepted

Answered
Pulling 100 out of 1000 values from a column matrix
iwant = A(1:100)

5 years ago | 0

| accepted

Answered
I need to write a for loop that will find the largest value.
k = 10 ; limit = 100; thesum = 0 ; for i = 1:k thesum = thesum+i^i/10 ; if thesum >= limit break e...

5 years ago | 0

Answered
How to get the x, y data after using smoothing spline in Matlab?
%Load the x-axis data filename1 = 'Time.xlsx'; Time = xlsread(filename1); %Load the y-axis data filename2 = 'X.xlsx'; X= xl...

5 years ago | 0

Answered
how can i change the error in line 80 column 18?
This line: y = fast fourier transform (x,n); Why there are spaces? Is it a function or you mean y = fft(x,n); Note that ther...

5 years ago | 1

| accepted

Answered
Compare two arrays of different lengths and return logical
Read about ismember.

5 years ago | 1

Answered
for loops and odd numbers
n = 8 ; x = 1:n ; idx = mod(x,2) odd_nus = x(logical(idx))

5 years ago | 1

| accepted

Answered
how to find features from '.txt' files?
txtFiles = dir('*.txt') ; N = length(txtFiles) ; meanGL= zeros(N,1); varianceGL = zeros(N,1) ; sd = zeros(N,1) ; skew = z...

5 years ago | 0

| accepted

Answered
How to mark range of Y values in a plot?
AStudent=randi(50,1,100); BStudent=randi(50,1,100); CStudent=randi(50,1,100); DStudent=randi(50,1,100); figure hold on p...

5 years ago | 0

| accepted

Answered
Integration of exponential function
syms t y(x) f = y(x)*exp(-2*(t-x)) ; int(f,x,0,t)

5 years ago | 0

Answered
How do I find max values in a vector
v=[1, 3, 5, 2, -4, -3, -1, 2, 3, 1, 2, -3, -2, -4] ; iwant = [max(v(v>0)) min(v(v>0)) max(v(v<0)) min(v(v<0))]

5 years ago | 0

Answered
plotting multiple vertical lines on a graph
figure(1) cla; scatter(x(:,a),y(:,a)) xlabel('X Coordinates') ylabel('Y Coordinates') title('Particle locations in the rice...

5 years ago | 0

| accepted

Answered
I want to change xlim,ylim of axes , and draw a circle at the point I chose when I click on a place in the axes in GUI
th = linspace(0,2*pi) ; R = 1. ; % Radius of circle x = R*cos(th) ; y = R*sin(th) ; figure axis([-5 5 -5 5]) ; % cahange...

5 years ago | 0

| accepted

Answered
Output of [~,IDX] = max(...) not in DOUBLE but in INT.
You can convert double into integer using int32 ot int64.

5 years ago | 0

Answered
How to plot a curve between 2 data sets
P1=[2.3;3.9;3.5;4.8;5.5;6.3;7.4]; P2=[4.8;5.7;6.5;7.8;9.2;10.5;11.8]; D=[78;65;57;52;46;32;27]; %% Dp=P2-P1; Q=0.24*D; % ...

5 years ago | 0

Answered
How to insert variables (string) in MATLAB function
syms t R=[1 0 0;0 cos(t) -sin(t); 0 sin(t) cos(t)]

5 years ago | 0

Answered
Monthly Time Series Plot
You can do intepolation by creating your required time stamps or use the inbuilt function retime. https://in.mathworks.com/help...

5 years ago | 0

Answered
How to change output format 20 culumn!
r = 2; % number of rows c = 30 ; % number of columns M=rand(r,c)

5 years ago | 0

Answered
How do I plot quivers on a curve?
If you are expecting colors based on the magnitude use this: https://in.mathworks.com/matlabcentral/fileexchange/3225-quiverc

5 years ago | 0

Answered
generate column array with day in year number for each hour in a year
r=repmat(0:364,24,1) ; r=r(:);

5 years ago | 2

| accepted

Load more