Community Profile # Chunru

Last seen: 1 jour il y a Actif depuis 2013

Matlab user since 1990

#### Statistiques

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

Afficher par

A répondu
Cannot save a matrix into a csv file correctly
A = [0.001 9.86543 0.002 5.26811 0.003 4.9170] writematrix(A, "matrixA.txt"); type matrixA.txt

environ 21 heures il y a | 0

A répondu
Finding a definite integral
Assuming that u and k are constant vectors: u = randn(1, 100); k = randn(1, 100); syms x f = (u+k)*int(1.5*exp(-2*(1-x)), ...

3 jours il y a | 0

A répondu
I need help with this code
figure; facesColor = {[1 0.5 0], [1 1 1], [1 0 0], [1 1 0], [0 0 1], [0 1 0]}; acesVertices(:,:,1) = [0 0 0; 1 0 0; 1 1 0;...

3 jours il y a | 0

A répondu
Speed of the abs function
" squaring was a expensive operation" This is ture for VERY OLD cpu or some special purpose CPUs. In modern general purpose CP...

3 jours il y a | 2

A répondu
How to draw a 3D surface with all the given discrete points？

4 jours il y a | 0

A répondu
polar data 3d plot
r = linspace(0,100, 101)'; theta = linspace(0, 360, 61); t = 1; % single t point for simplicity here u = 1./r.*cos(2*pi*.05...

4 jours il y a | 0

A répondu
How do I get this plot in Matlab?
% Define the general solution % [2 -1] and [1 2] are vectors. Use [ ]. X_general = @(t, c1, c2) (c1 * [2 -1] .* exp(-t)+ c2 *...

4 jours il y a | 0

A répondu
Plotting a curve using two interdependent intervals
You need array division ./ instead of / v=0:373; td=0.5; ts=0.2; g=9.81; a=0; p=1.204; cx=0.35; cz=-0.05; ax=1.77; m=1240; u=1...

7 jours il y a | 0

A répondu
Generate specific binary combination
You can put the dec2bin inside the loop so it won't be a big array. N = 4; for i=0:2^N-1 c = dec2bin(i, N) - '0' end

8 jours il y a | 1

A répondu
why the real matrix becomes complex number when transfered to cell
You won't get complex output if FD is real. Check type of FD. S=15; %smaller N=6; FD = rand(N*S, S); FY=cell(S,S) f...

9 jours il y a | 0

A répondu
How can I use various colors to fill the area under a normal distribution curve?
data = randn(8192, 1); h = histfit(data); pd = fitdist(data,'Normal') figure; x = linspace(-4*pd.sigma, 4*pd.sigma, 1001);...

10 jours il y a | 1

A répondu
problem of using findpeaks

10 jours il y a | 1

A répondu
pdeplot with same colorbar range
Use clim for each subplot. figure; subplot(3,1,1) pdeplot(model,"XYData",u(:,1),"Contour","on", "ColorMap","jet") clim([0 76...

10 jours il y a | 0

| A accepté

A répondu
issues with making a matlab firfilter

11 jours il y a | 0

A répondu
how to use writetable for one sheet?
inputData = [0.001 0.1; 0.003 0.1; 0.006 0.1; 0.1 0.09; 0.3 0.08; 0.5 0.07; 5 0.01; 7 0.005; ...

11 jours il y a | 1

| A accepté

A répondu
How to store each iteration of a loop as it's own varible.
syms k h g_dot T_inf L delta_x %symbolic varibles. T = sym('t',[8,1]); EQ = sym('eqn',[8,1]); n = 8; %for i = n-(n-1):1:n ...

11 jours il y a | 0

| A accepté

A répondu
how to get real frequency components using MUSIC compute frequency?
rng default n = 0:199; f1 = 0.257/2; f2 = 0.2/2; fs= 2; % fs (fs>2*max(f1, f2) % generate signal according to f1...

11 jours il y a | 0

A répondu
A problem with xtick

14 jours il y a | 0

| A accepté

A répondu
How to plot specified data points on a polar plot with curved lines, instead of straight lines
c_2 = [780.980150003248 900.818303825083 956.494860478838 855.216748671708 999.328305026861 784.311636929536 806.164595552563] ...

15 jours il y a | 0

A répondu
How to write a diagonal rectangular matrix
You can use toeplitz function. % Smaller n, m here n = 10; m = 8; A = diag(21*ones(n,1)) + diag(-4*ones(n-1,1),-1)... ...

15 jours il y a | 0

| A accepté

A répondu
Bode plot of individual poles and zeros
z = 1000; p = [10 10 100]; k = 200; bode(zpk(z, p, k), 'k'); hold on for i=1:length(z) bode(zpk(z(i), [], 1/z(i)), ...

15 jours il y a | 0

A répondu
How can I plot multiple signals in a single plot? Please give me suggestions which functions have used for this.
% Generate som data fs = 1000; t=(0:1/fs:1)'; f = 10:10:40; x = sin(2*pi*t*f); x = x + 0.1*randn(size(x)); n = size(x, 2)...

15 jours il y a | 0

| A accepté

A répondu
How to retrieve data from a Excel sheet saved at a particular location in pc?
You need to provide the extension name (.xlsx ?) to the file.

16 jours il y a | 0

| A accepté

A répondu
How do you output both variable values and names in a function?
You can consider to use struct which has field names. t = Epoch_calc(20231121) function t = Epoch_calc(recorded_date) %EPOCH_...

17 jours il y a | 0

A répondu
I have an Excel sheet with headers of different depths and the numbers are not being read (ex.: d=-12.82m is being read as x_12_82M),
% The first row is treated as var names. Use preserve to keep the original % format a = readtable("https://www.mathworks.com/...

18 jours il y a | 1

| A accepté

A répondu
How do I form a matrix from an array of rows and columns
A=ones(10); a=[1 3 5 6 9]; b=[1 2 4 7 9]; A(sub2ind(size(A), a,b)) = 0; A

19 jours il y a | 1

| A accepté

A répondu
how to create shape on xy surface?

21 jours il y a | 0

| A accepté

A répondu
How to create a pulsing sound/use duty cycle
It seems that nSeconds should be 0.5s. Each pause should be also 0.5s. Thus it repeats 60 time in a min. Fs = 8000; %# S...

23 jours il y a | 0

| A accepté

A répondu
Need Help with FFT Analysis and Power Factor Calculation in MATLAB
Here is the work flow: 1.Read the CSV data in MATLAB with the "t" and "i(t)" column header as a table x = readtable("https:/...

24 jours il y a | 0

A répondu
Can I access the code for my packaged app?
Perhaps the most straightforward way is to convert your m-code to pcode (doc pcode for more details). Compiling is another optio...

24 jours il y a | 1

| A accepté