Beantwortet
How to; For loop of angle in projectile motion
You are not updating the theta0 to find the range. You need to input theta0 to the function. clc; clear all ; g = 9.82; %grav...

mehr als 3 Jahre vor | 1

Beantwortet
Plot a 3d surface
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1101840/Ex12.xlsx') ; data = table2array(T) ; x =...

mehr als 3 Jahre vor | 0

Beantwortet
Ploting a 3d figure by exel data
T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1101815/Ex12.xlsx') ; data = table2array(T) ; x =...

mehr als 3 Jahre vor | 0

Beantwortet
How to save outputs from previous iterations and plot
n = 180 ; a = zeros(1,n) ; a(1) = 20000; R = 0.06; r = R/12; z = amortization(a(1),R,n); for i = 2:n b = a(i-1)*r...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to sort all rows in one table based on one row from the table and another table
Read about ismember T1 = {'Mom', 'Dad' 'Sister'} ; T2 = {'Sister', 'Mom', 'Dad'}; [c,ia] = ismember(T1,T2) ; T2(ia) Now use...

mehr als 3 Jahre vor | 0

Beantwortet
Spline interpolation of 4D matrix
A = rand(450,450,50,3) ; B = zeros(size(A)) ; for i = 1:450 for j = 1:450 for k = 1:50 B(i,j,k,:) ...

mehr als 3 Jahre vor | 0

Beantwortet
How to take average of such an array?
% Make data for demo A = cell(6,2) ; for i = 1:6 for j = 1:2 A{i,j} = rand(1,10) ; end end % Get mean i...

mehr als 3 Jahre vor | 0

Beantwortet
How to get sample names from scatter plot in classification learner
If you have feature1, feature2 in hand, you can use knnsearch to get the index and then check the sample name. If you are havi...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Why does not string(f.name) work, f = dir(folder)?
folder = "~/Documents" f = dir(folder) ; % f is a structure for i = 1:length(f) f(i).name end

mehr als 3 Jahre vor | 1

Beantwortet
Plotting the function on a Sphere?
r = 1 ; th = linspace(0,2*pi) ; phi = linspace(0,pi) ; [T,P] = meshgrid(th,phi) ; X = r*cos(T).*sin(P) ; Y = r*sin(T).*sin(...

mehr als 3 Jahre vor | 0

Beantwortet
Generate a sequence/vector of randomized letters
a='A':'Z'; letters= a(randi(numel(a), 1, 10)) iwant = strjoin(cellstr(letters'),',')

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Plot 2-d contour of 3D dataset
How about this? T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1099910/data_16082022.csv') ; x ...

mehr als 3 Jahre vor | 0

Beantwortet
Solve the following differential equations using Matlab.
syms p(x) ode = diff(p)+8*p==9 ; cond = p(0)==-1 ; pSol(x) = dsolve(ode,cond)

mehr als 3 Jahre vor | 0

Beantwortet
Compare 2 Matrixs Different Dimension With For
A = [1 1 1 1 2 4 2 3 2 1]; B = [4 1 3 1 2]; idx = A'==B

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Create an image from x and y locations with greyscale value
data = [0 0 255 0 0.5 70 0 1 111 0.5 0 26 0.5 0.5 26 0.5 1 255 1 0 108 1 0.5 26 1 1 70] ; x = data(:,1) ; y = data(:...

mehr als 3 Jahre vor | 0

Beantwortet
getting x and y values and writing them
Already you have data in hand. If you want to write that into a file use: data = [t(:) x(:)] ; writematrix(data,'data.txt') ;...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to draw phase portrait
plot(t,xa(:,1)) In the baove use your required index for the column and plot. You can use quiver, if you have vectors. Assumin...

mehr als 3 Jahre vor | 0

Beantwortet
3D dose plot and color wash
T = readtable('myfile.xlsx') ; scatter3(T.(1),T.(2),T.(3),[],T.(4),'filled')

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
I HAVE A KEY WHICH IS 1*16 MATRIX. HOW CAN I DETERMINE IT'S BIT SIZE?
KEY=[0 0 1 0 3 12 8 7 7 8 12 3 0 1 0 0] ; a = single(KEY) ; iwant = whos('a')

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Create a structure of a field in the workspace
You can save them into a matfile and access, as you like. A = 1 ; B = 2; C = 3 ; save Test.mat ; S = matfile('Test.ma...

mehr als 3 Jahre vor | 0

Beantwortet
append data to the already existed .txt file horizontally
T1 = readtable('file1.txt') ; T2 = readtable('file2.txt') ; T = [T1 T2] ; writetable(T,'file.txt')

mehr als 3 Jahre vor | 0

Beantwortet
overlap the same data 5 times
Let M be the matrix in your mat file. matFiles = dir('*.mat') ; N = length(matFiles) ; iwant = []; for i = 1:N S = ma...

mehr als 3 Jahre vor | 0

Beantwortet
How to determine an y value at a specific x value?
Read about interp1

fast 4 Jahre vor | 0

Beantwortet
How to get the first derivative of pixels along of line?
REad about gradient

fast 4 Jahre vor | 0

Beantwortet
How to plot this ellipse
syms s1 s2 t = 0 ; eqn = s1^2-15.156*s1*s2+229.7*s2^2+488.8*t^2+6844000*s2==4.752*10^10 ; fimplicit(eqn,[-600000 200000 -100...

fast 4 Jahre vor | 1

Beantwortet
Integrate a polyfit-polyval in matlab, I would appreciate any input. I want to calculate the integral of the sine function from a trend li
%% Integration p2=polyfit(X,Y,4); fun = @(x) p2(1)*x.^4+p2(2)*x.^3+p2(3)*x.^2+p2(4)*x+p2(5) ; % using p2 from polyfit val =...

fast 4 Jahre vor | 0

| akzeptiert

Beantwortet
solve equation numerically 1=(1/y)x*exp(x*y)
syms x y f = 1==1/y*x*exp(x*y) solve(f,x) solve(f,y)

fast 4 Jahre vor | 0

Beantwortet
How to remove leading zeros in decimal representation?
A = [23, 15, 256, 75]; B= dec2bin(A) strip(string(B),'left','0')

fast 4 Jahre vor | 1

| akzeptiert

Beantwortet
I want to select an Excel file by it's extension
%% Here only 1 Excel file will be present in ComparySummary folder. And I want select that Excel file with FilePath %% FilePath...

fast 4 Jahre vor | 0

Beantwortet
How to retrieve the specific rows with all the columns in the dataset?
I hope the dataset is in the form of a table. So your table is going to be of size 2832x4. idx = T.Time==1.5 ; T1 = T(idx,:) ...

fast 4 Jahre vor | 0

| akzeptiert

Mehr laden