Answered

Extract a range of frequencies from a vector/array

new_value_from_fnew = fnew(fnew == 10e+009 | fnew > 30e+009); % <--- replace = with ==

Extract a range of frequencies from a vector/array

new_value_from_fnew = fnew(fnew == 10e+009 | fnew > 30e+009); % <--- replace = with ==

10 dagar ago | 0

| accepted

Answered

Trying to define a circle within a matrix

[X,Y] = meshgrid(1:50) ; C = [mean(X(:)) mean(Y(:))] ; R = 10 ; th = linspace(0,2*pi) ; x = C(1)+R*cos(th) ; y = C(2)+R...

Trying to define a circle within a matrix

[X,Y] = meshgrid(1:50) ; C = [mean(X(:)) mean(Y(:))] ; R = 10 ; th = linspace(0,2*pi) ; x = C(1)+R*cos(th) ; y = C(2)+R...

11 dagar ago | 0

Answered

How to find coordinate if only x is given?

Rm = sqrt(x.^2+y.^2) ; % get radius from mexh (x,y) R = 75 ; tol = 10^-3 ; idx = find(abs(Rm-R)<tol) ; iwant = [idx x(idx)...

How to find coordinate if only x is given?

Rm = sqrt(x.^2+y.^2) ; % get radius from mexh (x,y) R = 75 ; tol = 10^-3 ; idx = find(abs(Rm-R)<tol) ; iwant = [idx x(idx)...

11 dagar ago | 0

Answered

How to read all CSV files within a folder, combine into one master file using columns, and edit column headers?

folderPath1 = 'C:\Users\matav\Documents\MATLAB\example'; cd(folderPath1); % opens path of the folder csvFiles = dir('*.csv') ;...

How to read all CSV files within a folder, combine into one master file using columns, and edit column headers?

folderPath1 = 'C:\Users\matav\Documents\MATLAB\example'; cd(folderPath1); % opens path of the folder csvFiles = dir('*.csv') ;...

11 dagar ago | 0

Answered

How do these Python commands have to look in Matlab to calculate A and B and show me the two results?

A = 10+10; B = A+10 ; fprintf('A = %f, B = %f\n',A,B) ;

How do these Python commands have to look in Matlab to calculate A and B and show me the two results?

A = 10+10; B = A+10 ; fprintf('A = %f, B = %f\n',A,B) ;

11 dagar ago | 0

| accepted

Answered

Read multiple CSV files from different folders uing readtable

thepaths = {p1,p2,p3} ; for i = 1:3 % loop for ech folder csvFiles = dir([thepaths{i},'\*csv']) ; % get ll csv files in ...

Read multiple CSV files from different folders uing readtable

thepaths = {p1,p2,p3} ; for i = 1:3 % loop for ech folder csvFiles = dir([thepaths{i},'\*csv']) ; % get ll csv files in ...

11 dagar ago | 0

Answered

read many ncdata using ncread

ncfiles = dir('*.nc') ; N = length(ncfiles) ; for i = 1:N thisfile = ncfiles(i).name ; % do your calculation end...

read many ncdata using ncread

ncfiles = dir('*.nc') ; N = length(ncfiles) ; for i = 1:N thisfile = ncfiles(i).name ; % do your calculation end...

14 dagar ago | 0

| accepted

Answered

streamline function gives empty output

Try replacing NaN's in u, v with zero and use stream2.

streamline function gives empty output

Try replacing NaN's in u, v with zero and use stream2.

14 dagar ago | 0

Answered

Graph appears blank but the equation and code are correct.

H_k_eq = @(k) (exp(-pi.*k.^2)) ./ (exp(-pi.*k.^2) + exp(-pi.*(4.*k).^2)); %<-- element by element division Range = -0.5:.01:...

Graph appears blank but the equation and code are correct.

H_k_eq = @(k) (exp(-pi.*k.^2)) ./ (exp(-pi.*k.^2) + exp(-pi.*(4.*k).^2)); %<-- element by element division Range = -0.5:.01:...

14 dagar ago | 1

Answered

Solving Unknowns with Symbolic Toolbox

A = [1 1 0 0 ; 0 0 1 1 ; 1 0 1 0 ; 0 1 0 1] ; b = [3;7;4;6] ; x = pinv(A)*b Note that rank of A is 3, so...

Solving Unknowns with Symbolic Toolbox

A = [1 1 0 0 ; 0 0 1 1 ; 1 0 1 0 ; 0 1 0 1] ; b = [3;7;4;6] ; x = pinv(A)*b Note that rank of A is 3, so...

14 dagar ago | 0

| accepted

Answered

Plotting a 3D matrix with plot3

LambdaL = linspace(0.000001,0.0001,20); % [Matrix in X axis] LambdaT = linspace(0.000001,0.0001,20); % [Matrix in Y axis] ...

Plotting a 3D matrix with plot3

LambdaL = linspace(0.000001,0.0001,20); % [Matrix in X axis] LambdaT = linspace(0.000001,0.0001,20); % [Matrix in Y axis] ...

15 dagar ago | 0

Answered

Write a program to input 3 integer digits (from 100 - 999), then in the numbers letters in hundreds, tens, and units ?

Read about input and see this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/47221-number-to-words

Write a program to input 3 integer digits (from 100 - 999), then in the numbers letters in hundreds, tens, and units ?

Read about input and see this file exchange: https://in.mathworks.com/matlabcentral/fileexchange/47221-number-to-words

16 dagar ago | 0

Answered

How to Plot Excel file in MatLab

Load the excel file into MATLAB using readtable. If you have time series; use plot. If 2D use pcolor. If scattered data use scat...

How to Plot Excel file in MatLab

Load the excel file into MATLAB using readtable. If you have time series; use plot. If 2D use pcolor. If scattered data use scat...

16 dagar ago | 0

Answered

Multiple data file loading to run some functions

fname = dir('*.txt') ; % gets all text files N = length(fname) ; for i = 1:N txtFile = fname(i).name ; % load t...

Multiple data file loading to run some functions

fname = dir('*.txt') ; % gets all text files N = length(fname) ; for i = 1:N txtFile = fname(i).name ; % load t...

16 dagar ago | 0

| accepted

Answered

Rotating X & Y Data

p1 = rand(2,1) ; p2 = rand(2,1) ; %%rotation matrix th = 90*pi/180 ; R = [cos(th) -sin(th) ;sin(th) cos(th)] ; %%rotate po...

Rotating X & Y Data

p1 = rand(2,1) ; p2 = rand(2,1) ; %%rotation matrix th = 90*pi/180 ; R = [cos(th) -sin(th) ;sin(th) cos(th)] ; %%rotate po...

17 dagar ago | 0

Answered

Finding equilibrium points for an ODE system

tol = 10^-5 ; % change the tolerance idx = abs(cdot)<tol & abs(cddot)<tol ; [cdot(idx) cddot(idx)]

Finding equilibrium points for an ODE system

tol = 10^-5 ; % change the tolerance idx = abs(cdot)<tol & abs(cddot)<tol ; [cdot(idx) cddot(idx)]

17 dagar ago | 0

Answered

Hello I'm getting this warning "Variable 'x1' might be set by a nonscaler operator".

You case x1, x2 are vectors and you cannot use the condition like that. You have to use like shown below. n = -5:5; A = 0.8...

Hello I'm getting this warning "Variable 'x1' might be set by a nonscaler operator".

You case x1, x2 are vectors and you cannot use the condition like that. You have to use like shown below. n = -5:5; A = 0.8...

17 dagar ago | 0

Answered

connecting points with the same value

REad about contour Z = peaks(100) ; pcolor(Z) ; shading interp hold on contour(Z,[1 1],'k') % show/join the value 1 with ...

connecting points with the same value

REad about contour Z = peaks(100) ; pcolor(Z) ; shading interp hold on contour(Z,[1 1],'k') % show/join the value 1 with ...

17 dagar ago | 0

Answered

How to use imported data with trapz( )

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1129920/H182%20Drag.csv') ; x = T.(1) ; y = T.(2)...

How to use imported data with trapz( )

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1129920/H182%20Drag.csv') ; x = T.(1) ; y = T.(2)...

17 dagar ago | 0

Answered

Join strings together with '_' between them

a = {'A11';'A12';'A21';'A22';'A23';'A24'}; b = {'A300';'A5300';'A291';'A5291'}; a1 = repmat(a,length(b),1) ; b1 = repelem(b...

Join strings together with '_' between them

a = {'A11';'A12';'A21';'A22';'A23';'A24'}; b = {'A300';'A5300';'A291';'A5291'}; a1 = repmat(a,length(b),1) ; b1 = repelem(b...

17 dagar ago | 0

| accepted

Answered

How do I compute the standardized sample mean from this data?

N = 10000; a=0; b=1; x = a+(b-a)*rand([N,1]); lambda = 1; Y = -log(x)/lambda; Y_std = (Y-mean(Y))/std(Y) ; mean(Y_std)

How do I compute the standardized sample mean from this data?

N = 10000; a=0; b=1; x = a+(b-a)*rand([N,1]); lambda = 1; Y = -log(x)/lambda; Y_std = (Y-mean(Y))/std(Y) ; mean(Y_std)

17 dagar ago | 0

Answered

Create a Matrix with Euclidian Distances between Coordinates

A = rand(8,2,3) ; B = permute(A,[1 3 2]); B = reshape(B,[],size(A,2),1) ; iwant = squareform(pdist(B))

Create a Matrix with Euclidian Distances between Coordinates

A = rand(8,2,3) ; B = permute(A,[1 3 2]); B = reshape(B,[],size(A,2),1) ; iwant = squareform(pdist(B))

17 dagar ago | 1

| accepted

Answered

Use a command only once

Make theta_b also a input variable. % Inputs are reference voltage Vdr and Vqr,reference current ,Idr and Iqr % and measured ...

Use a command only once

Make theta_b also a input variable. % Inputs are reference voltage Vdr and Vqr,reference current ,Idr and Iqr % and measured ...

18 dagar ago | 0

Answered

How do I extract values of a matrix based upon an ID array?

REad about knnsearch x = [0 0 1 2] ; y = [0 0 1 2] ; [X,Y] = meshgrid(x,y) ; A = rand(4) ; idx = knnsearch([X(:) Y(:)],[1 ...

How do I extract values of a matrix based upon an ID array?

REad about knnsearch x = [0 0 1 2] ; y = [0 0 1 2] ; [X,Y] = meshgrid(x,y) ; A = rand(4) ; idx = knnsearch([X(:) Y(:)],[1 ...

18 dagar ago | 0

Answered

How to plot and filter some values from a csv file?

sonar_F_030 = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1127720/sonar_F_030.csv'); x1 = sonar_F_...

How to plot and filter some values from a csv file?

sonar_F_030 = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1127720/sonar_F_030.csv'); x1 = sonar_F_...

20 dagar ago | 0

Answered

How to graph 3 cylinders together.

Youmay modify the belo code and achieve it. Radius = 2. ; % Radius of the cylindrical theta = 360. ; % A...

How to graph 3 cylinders together.

Youmay modify the belo code and achieve it. Radius = 2. ; % Radius of the cylindrical theta = 360. ; % A...

21 dagar ago | 0

Answered

not able to plot

You need to save like shown bel and then plot: clc %% DESIGN ASSIGNMENT 1 %% %%-----------given----------%% Alt = 35000...

not able to plot

You need to save like shown bel and then plot: clc %% DESIGN ASSIGNMENT 1 %% %%-----------given----------%% Alt = 35000...

21 dagar ago | 0