Risposto
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

12 mesi fa | 0

Risposto
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)), ...

12 mesi fa | 0

Risposto
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;...

12 mesi fa | 0

Risposto
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...

12 mesi fa | 2

Risposto
How to draw a 3D surface with all the given discrete points?
load(websave("XYZ_data.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1559554/XYZ_data.mat")) whos figu...

12 mesi fa | 0

Risposto
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...

12 mesi fa | 0

Risposto
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 *...

12 mesi fa | 0

Risposto
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...

12 mesi fa | 0

Risposto
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

12 mesi fa | 1

Risposto
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...

12 mesi fa | 0

Risposto
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);...

12 mesi fa | 1

Risposto
problem of using findpeaks
load(websave("19year.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1553817/19year.mat")) % It seems tha...

12 mesi fa | 1

Risposto
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...

12 mesi fa | 0

| accettato

Risposto
issues with making a matlab firfilter
%[x, fs] = audioread('SunshineSquare.wav'); load handel.mat audiowrite("handel.wav", y, Fs); [x, fs] = audioread('handel...

12 mesi fa | 0

Risposto
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; ...

12 mesi fa | 1

| accettato

Risposto
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 ...

12 mesi fa | 0

| accettato

Risposto
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...

12 mesi fa | 0

Risposto
A problem with xtick
It works here without problem. S=load(websave("LandauData.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files...

12 mesi fa | 0

| accettato

Risposto
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] ...

quasi un anno fa | 0

Risposto
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)... ...

quasi un anno fa | 0

| accettato

Risposto
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)), ...

quasi un anno fa | 0

Risposto
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)...

quasi un anno fa | 0

| accettato

Risposto
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.

circa un anno fa | 0

| accettato

Risposto
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_...

circa un anno fa | 0

Risposto
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/...

circa un anno fa | 1

| accettato

Risposto
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

circa un anno fa | 1

| accettato

Risposto
how to create shape on xy surface?
websave("variable.mat", "https://www.mathworks.com/matlabcentral/answers/uploaded_files/1538662/variable.mat"); S = load('varia...

circa un anno fa | 0

| accettato

Risposto
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...

circa un anno fa | 0

| accettato

Risposto
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:/...

circa un anno fa | 0

Risposto
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...

circa un anno fa | 1

| accettato

Carica altro