Community Profile Chunru

Last seen: Today Active since 2013

Matlab user since 1990

Statistics

All
• • • • • • • • • • • • Content Feed

View by

Determine frequency of signals
load signal1 fs = 1; % normalized freq y = abs(fft(x)); L = length(y); f = (0:round(L/2)-1)/L*fs; p = y(1:round(L...

6 days ago | 0

How to integrate LFM signal into pulse
fl = 100; % Hz fu = 200; fs = 1000; pw = 0.1; % sec pri = 1; % sec % LFM t = (0:1/fs:pw)'; x = cos(2*pi*(fl*t + ...

6 days ago | 0

| accepted

Two x-axis (Arrhenius plots)
Not sure your equation. But you can modify the following to produce the plot: x = linspace(2.5, 4, 20); % x corrdinate ...

6 days ago | 0

| accepted

How do I find a specific x values in an array(?) of x,y locations?
% floating point inside computer may not be exact find(abs(locations - 143.4955) < 10*eps)

11 days ago | 0

Hi, I want to make the final output to 4 decimal places. But it kept showing only 1. I tried a lot but doesn't work. Please help me
Ass_1 = 60; Ass_2 = 75; Ass_3 = 80; totalass = (Ass_1 +Ass_2 + Ass_3)/3; %Quizzes quiz_1 = 76; quiz_2 = 90; quiz_3 = 54;...

11 days ago | 1

| accepted

store strings and numbers into an array
% You can use structure array PersonInfo(1) = struct("Name", "Peter", "Age", 28); PersonInfo(2) = struct("Name", "Fabian", "Ag...

12 days ago | 0

Vectorize nested for loop with matrix indexing
% The following code is slow, because the array size is growing. Memory % allocation will slow down the program % Z1_encryp...

12 days ago | 0

| accepted

plot complex eigenvalues over time
n = 20; x = (3+randn(n,8)) + 1i*(2+randn(n, 8)); % generate some data 20x8 instead of 1584 x 8 cmap = jet(n); % use differe...

14 days ago | 0

Convert Cell Arrays Containing Cell Arrays to separate columns
fn ='dbe-ew-transient analysis - 5% critical damped.f06'; linenum = 165164; M = readmatrix(fn, 'Range', 165164+":"+999);

14 days ago | 1

How can i Assign the value of cut-off frequency ?
f=[0.01:0.01:2e04]; s=2*pi*f; wc1=j*2*pi*10; % fc wc2=j*2*pi*500; H1=(s+wc1).^-1; H2=(s.^2+(wc1+wc2)*s+wc1*wc2).^-1; MH1...

18 days ago | 0

How to delete 'Userdata' in hObject of Matlab GUI?

19 days ago | 1

how to make the label inside this graph that arrow sin(pi/2) and how to make the grid like tht blurry and no cut line
t = linspace(-pi, pi, 41); x1 = sin(1*t); x2 = sin(2*t); plot(t, x1, 'bo-', t, x2, 'r*-'); grid on pos = get(gca, 'Position...

19 days ago | 0

How to change a Data Series contained with Repeated NaNs to become other sequence of NaNs?
A = [NaN, NaN, 0, 0, 0, NaN, NaN, 0, 0, 0, 0, 0, NaN, NaN, 0, NaN, NaN]; idx = isnan(A); % any repeated nan will be replaced w...

20 days ago | 1

from a python code to matlab code
hairstyles = ["bouffant", "pixie", "dreadlocks", "crew", "bowl", "bob", "mohawk", "flattop"]; prices = [30, 25, 40, 20, 20, 35,...

20 days ago | 0

How to plot multiple layers of heatmap as a function of a third variable in the z direction
[X,Y,Z] = meshgrid(-2:.2:2); V = X.*exp(-X.^2-Y.^2-Z.^2); zslice = [-1.2,0,1.2]; yslice = []; xslice = []; slice(X,Y,Z...

20 days ago | 0

from a python code to matlab code
% cuts_under_30 = [hairstyles[i] for i in range(len(hairstyles)) if new_prices[i] < 30] cuts_under_30 = hairstyles(new_prices <...

20 days ago | 0

Calculation of phase of signal
fs = 50; ns1 = 200; % samples for x1 f1 = 1; x1 = sin(2*pi*f1*(0:ns1-1)/fs); % first part % Try to make the fist...

21 days ago | 0

| accepted

area of 10m2 .overa 0.05 − −t 0.000018t^2
% The function name is "f" not "dtdT" [t,T]=ode45(@f,[0 3600],(40)); plot(t,T,'-') xlabel('Time (s)') ylabel('Temperature (o...

21 days ago | 1

augmentation of pretrained network reducing accuracy
Generally speaking, training with data augmentation will lead to poorer traing accuracy, since the model needs to fit more trai...

21 days ago | 0

| accepted

Custom levels in contourf
load variablesForQuestion v20=[-25 -20 -15 -10 -5 0 5 10 15 22.5 25]; subplot(131); % Your data CI has range from -17 t0 100 ...

21 days ago | 0

I can not see the correct x axos number
n_temp=linspace(14,18,1000); % x-axis [cm^-3] n=10.^(n_temp); plot(n_temp, n)

22 days ago | 0

Average of 3 one dimensional matrix loaded by .mat file

22 days ago | 0

| accepted

"audioread" multiple audio files in a folder
clear all; audio_files = dir('C:\Users\KOH\Desktop\MATLABcode\Soundsample\SPTGRM*.wav') for i=1:numel(audio_files) % You ...

22 days ago | 0

How to know the smallest number after 0
P = randi([0 65535], [5 5 10], 'uint16'); % smaller size for demonstration P1 = P(:); min(P1(P1>0))

22 days ago | 0

What might be wrong with the code?
The data you plot is a straight line. The expected data should be something shown below. E1=-13.6; E2=-3.4; k=8.617*1...

23 days ago | 0

pie chart subdivision of a sector
x = [73.1 39.3 29.9 8.2 7.2 6.2]; xp = x/sum(x); x1 = [xp(1:2) sum(xp(3:end))]; x2 = xp(3:end); figure; hold on theta0 = 0;...

25 days ago | 0

| accepted

transparency line of polar graph
theta = deg2rad(0:360); r = cos(theta).^2; a = polar(theta, r); a.Color =[1,0,0, .2]; % use the last value to control the tra...

27 days ago | 0

| accepted

how can i combine two graph which is linear and semilogy into one graph by using legend,the input is same for the linear and log graph
x = (1:10); y1 = rand(10,1); y2 = 10.^(3*randn(10,1)); yyaxis left plot(x, y1, 'ro-') yyaxis right semilogy(x, y2, 'b*-')

27 days ago | 0

| accepted

How can i show only definite data values in bar plot?
X=1:7; Y=[100 50 35 20 8 7 6]; idx = 1:3; % select data to plot bar(X(idx), Y(idx)); text(X(idx),Y(idx),num2str(Y(idx)'...

27 days ago | 0

| accepted