Answered

Having trouble calling a user defined function.

TableOne = array2table([1988*ones(10,1) randn(10, 2)]) TableTwo = array2table([1988*ones(10,1) randn(10, 2)]) %This complete...

Having trouble calling a user defined function.

TableOne = array2table([1988*ones(10,1) randn(10, 2)]) TableTwo = array2table([1988*ones(10,1) randn(10, 2)]) %This complete...

4 days ago | 0

Answered

Volume formed by a moving triangle

% initial triangle p1 = [0, 0, 0]; p2 = [3, 0, 0]; p3 = [0 4 0]; % the velocity vector should be specified (instead of final t...

Volume formed by a moving triangle

% initial triangle p1 = [0, 0, 0]; p2 = [3, 0, 0]; p3 = [0 4 0]; % the velocity vector should be specified (instead of final t...

7 days ago | 0

| accepted

Answered

How could I sums up 1/n for n=1 to 10000?

It can be run as shown below. What problem have you encountered? n = 10000; % whatever you want sum_harm = 0; for i = 1:n ...

How could I sums up 1/n for n=1 to 10000?

It can be run as shown below. What problem have you encountered? n = 10000; % whatever you want sum_harm = 0; for i = 1:n ...

7 days ago | 0

Answered

i need series representation for the equation of erfc(x) and maching with it in plot

x = 0.5; format long erfc(x) for n=1:20 y(n) = erfc_by_series(x, n); end y' function y= erfc_by_series(x, n) ...

i need series representation for the equation of erfc(x) and maching with it in plot

x = 0.5; format long erfc(x) for n=1:20 y(n) = erfc_by_series(x, n); end y' function y= erfc_by_series(x, n) ...

7 days ago | 0

| accepted

Answered

How to show that DFT follows N^2 number of operations?

One simple way is to plot sqrt(dft_time) vs n to see if it is a straight line. Generally speaking, the computation time can b...

How to show that DFT follows N^2 number of operations?

One simple way is to plot sqrt(dft_time) vs n to see if it is a straight line. Generally speaking, the computation time can b...

7 days ago | 0

| accepted

Answered

Our professor calls this the connectivity array (but not referring to Matlab)

% [F G H ; % G I J; % H J F] % Then the 11x11 matrix should look like this: % [F G H 0 0 0 0 0 0 0 0; % G I J ...

Our professor calls this the connectivity array (but not referring to Matlab)

% [F G H ; % G I J; % H J F] % Then the 11x11 matrix should look like this: % [F G H 0 0 0 0 0 0 0 0; % G I J ...

7 days ago | 0

Answered

Numerical Double Integral in Matlab

It seems that the integration is separatable into two 1-D integrations: inner_term = W_t./b outer_term = a final_term = inner...

Numerical Double Integral in Matlab

It seems that the integration is separatable into two 1-D integrations: inner_term = W_t./b outer_term = a final_term = inner...

7 days ago | 0

Answered

Work with variable names in workspace that are mostly the same with a unique identifier at the end

clear;clc; %s = load('SampleData1.mat'); % load as a struct s = load('SampleData2.mat'); % figure out the varnam...

Work with variable names in workspace that are mostly the same with a unique identifier at the end

clear;clc; %s = load('SampleData1.mat'); % load as a struct s = load('SampleData2.mat'); % figure out the varnam...

7 days ago | 1

| accepted

Answered

Splitting a sentence into an array of letters

str = 'I am happy' % characar array % the char array str is stored as [ 'I' ' ' 'a' 'm' ' ' 'h' 'a' 'p' 'p' 'y' %...

Splitting a sentence into an array of letters

str = 'I am happy' % characar array % the char array str is stored as [ 'I' ' ' 'a' 'm' ' ' 'h' 'a' 'p' 'p' 'y' %...

7 days ago | 1

| accepted

Answered

where can i find a complete list of table variable types?

% Create table LastName = ["Sanchez";"Johnson";"Zhang";"Diaz";"Brown"]; Age = [38;43;38;40;49]; Smoker = [true;false;true;fal...

where can i find a complete list of table variable types?

% Create table LastName = ["Sanchez";"Johnson";"Zhang";"Diaz";"Brown"]; Age = [38;43;38;40;49]; Smoker = [true;false;true;fal...

8 days ago | 0

Answered

How can I merge the values of one matrix into another matrix based on one column value?

A = zeros([7 4]); A(:,1) = 1104849000:60:1104849400; B = rand([3 4]); B(1,1) = 1104849000; B(2,1) = 1104849180; B(3,1) = 11...

How can I merge the values of one matrix into another matrix based on one column value?

A = zeros([7 4]); A(:,1) = 1104849000:60:1104849400; B = rand([3 4]); B(1,1) = 1104849000; B(2,1) = 1104849180; B(3,1) = 11...

8 days ago | 1

| accepted

Answered

Array indexing nested in a struct arrray

myTable(1).name='A'; myTable(1).data=[1:3]; myTable(2).name='A'; myTable(2).data=[4:6]; myTable(3).name='B'; myTable(3).dat...

Array indexing nested in a struct arrray

myTable(1).name='A'; myTable(1).data=[1:3]; myTable(2).name='A'; myTable(2).data=[4:6]; myTable(3).name='B'; myTable(3).dat...

8 days ago | 0

| accepted

Answered

How to mask the data of no information?

websave("two_targets.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1132000/Two_targets.mat"); load('two...

How to mask the data of no information?

websave("two_targets.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1132000/Two_targets.mat"); load('two...

8 days ago | 0

| accepted

Answered

IFFT of signal after transfer functions have been applied

Your transfer function Tf likely has values of 0 and the division operation Y./Tf making Y_corr has inf values so that IFFT cann...

IFFT of signal after transfer functions have been applied

Your transfer function Tf likely has values of 0 and the division operation Y./Tf making Y_corr has inf values so that IFFT cann...

8 days ago | 0

Answered

Plot polar plot for AOA

ax = polaraxes; hold on x=[ 157.9530 -133.5950 179.8410 -105.8580 180.6610 -121.5060 186.8470 -113.7320 187.5210 -...

Plot polar plot for AOA

ax = polaraxes; hold on x=[ 157.9530 -133.5950 179.8410 -105.8580 180.6610 -121.5060 186.8470 -113.7320 187.5210 -...

9 days ago | 1

| accepted

Answered

iir filter saturation problems

It seems that your implementation of filter is not correct and hencie make the iir filter not stable: for i = 7 : N BPF(i)...

iir filter saturation problems

It seems that your implementation of filter is not correct and hencie make the iir filter not stable: for i = 7 : N BPF(i)...

9 days ago | 0

Answered

How should we evaluate the similarity of two graphs?

load ellipse_original load ellipse_estimation whos plot(ellipse_original(:,1), ellipse_original(:,2), 'r', ellipse_estimation...

How should we evaluate the similarity of two graphs?

load ellipse_original load ellipse_estimation whos plot(ellipse_original(:,1), ellipse_original(:,2), 'r', ellipse_estimation...

9 days ago | 0

Answered

How to plot Magnetic field values on a sphere with a certain radius?

doc quiver3

How to plot Magnetic field values on a sphere with a certain radius?

doc quiver3

9 days ago | 0

Answered

How to rotate axis by 180 degree?

x=[1;0;0]; y=[0;1;0]; z=[0;0;1]; quiver3(0,0,0,x(1),x(2),x(3),'Color','green','LineWidth',2,'MaxHeadSize',0.5); hold on; qu...

How to rotate axis by 180 degree?

x=[1;0;0]; y=[0;1;0]; z=[0;0;1]; quiver3(0,0,0,x(1),x(2),x(3),'Color','green','LineWidth',2,'MaxHeadSize',0.5); hold on; qu...

9 days ago | 0

Answered

How to draw with semiology in MATLAB?

Q = [16,32,64,128,256,512,1024]; y = [9 9 9 9 5 0 0]*0.25; y1 = [45 37 25 21 5 0 ...

How to draw with semiology in MATLAB?

Q = [16,32,64,128,256,512,1024]; y = [9 9 9 9 5 0 0]*0.25; y1 = [45 37 25 21 5 0 ...

9 days ago | 0

| accepted

Answered

finding dft without using fft

% If you want to compare fft and dft, it's better to write dft as a % function and then perform the comparision. x = cos(2*pi*...

finding dft without using fft

% If you want to compare fft and dft, it's better to write dft as a % function and then perform the comparision. x = cos(2*pi*...

9 days ago | 0

| accepted

Answered

Reading and plotting data

x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1131005/Lab3.csv") x.('datetime') = datetime(x.ti...

Reading and plotting data

x = readtable("https://www.mathworks.com/matlabcentral/answers/uploaded_files/1131005/Lab3.csv") x.('datetime') = datetime(x.ti...

9 days ago | 0

Answered

Remove Certain Values in Matrix

Vel = [1,3,6,22,25,33; 11,12,15,12,15,67; 1,32,21,4,25,3; 11,12,5,33,15,7; 11,32,6,2,25,33; 1,0,0,...

Remove Certain Values in Matrix

Vel = [1,3,6,22,25,33; 11,12,15,12,15,67; 1,32,21,4,25,3; 11,12,5,33,15,7; 11,32,6,2,25,33; 1,0,0,...

9 days ago | 0

| accepted

Answered

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

close; clear; clc; n = -5:5; A = 0.8; x1 = A.^n; x2 = A.^(-n); if all(x1 == x2) % use all here to ensure all element...

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

close; clear; clc; n = -5:5; A = 0.8; x1 = A.^n; x2 = A.^(-n); if all(x1 == x2) % use all here to ensure all element...

10 days ago | 0

| accepted

Answered

surface 3d plot

[gm,km] =meshgrid(0.1:0.01:0.5, 0.1:0.01:0.5); % 1st surface R2 = gm.*(7.5581+ (0.0813+km)./(0.1129+km)); surf(gm,km,R2, 'Ed...

surface 3d plot

[gm,km] =meshgrid(0.1:0.01:0.5, 0.1:0.01:0.5); % 1st surface R2 = gm.*(7.5581+ (0.0813+km)./(0.1129+km)); surf(gm,km,R2, 'Ed...

10 days ago | 1

Answered

How can I discretize data by their sign?

A = [-2,-1,5,-10,7,3,-9,-12,11]; s = sign(A) s1 = [1 diff(s)~=0] y = cumsum(s1) % [1,1,2,3,4,4,5,5,6]

How can I discretize data by their sign?

A = [-2,-1,5,-10,7,3,-9,-12,11]; s = sign(A) s1 = [1 diff(s)~=0] y = cumsum(s1) % [1,1,2,3,4,4,5,5,6]

10 days ago | 0

Answered

Text file data segregation

type test.txt result = {}; fid = fopen("test.txt", "rt"); while ~feof(fid) i = fscanf(fid, "**DATA%d"); result{i} =...

Text file data segregation

type test.txt result = {}; fid = fopen("test.txt", "rt"); while ~feof(fid) i = fscanf(fid, "**DATA%d"); result{i} =...

10 days ago | 0

Answered

Find unique groups in table with members both before and after date

T=table({'Joe','Joe','Joe','Joe','Steve','Steve','Mary','Mary','Susan','Susan'}',... {'2022-02-03','2021-12-23','2022-08-01...

Find unique groups in table with members both before and after date

T=table({'Joe','Joe','Joe','Joe','Steve','Steve','Mary','Mary','Susan','Susan'}',... {'2022-02-03','2021-12-23','2022-08-01...

10 days ago | 0

| accepted

Answered

How can I join columns of an array without overlapping elements?

Not sure if this is what you intend to do: x = [1 1 0 0 0 0 0 0 0 0; 2 3 4 0 0 0 0 0 0 0; 0 1 1 1 0 0 0 0 0 0; ...

How can I join columns of an array without overlapping elements?

Not sure if this is what you intend to do: x = [1 1 0 0 0 0 0 0 0 0; 2 3 4 0 0 0 0 0 0 0; 0 1 1 1 0 0 0 0 0 0; ...

10 days ago | 0

| accepted

Answered

Read Multiple Files with While Loop

fn = dir("*.dat"); % or your file name pattern for i=1:length(fn) fn_c = fn(i).name % current filename to b...

Read Multiple Files with While Loop

fn = dir("*.dat"); % or your file name pattern for i=1:length(fn) fn_c = fn(i).name % current filename to b...

10 days ago | 0