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

5 Monate vor | 0

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

5 Monate vor | 2

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

5 Monate vor | 0

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

5 Monate vor | 0

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

5 Monate vor | 0

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

5 Monate vor | 0

Beantwortet
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

5 Monate vor | 1

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

5 Monate vor | 0

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

5 Monate vor | 1

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

5 Monate vor | 1

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

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

5 Monate vor | 1

| akzeptiert

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

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

5 Monate vor | 1

| akzeptiert

Beantwortet
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

5 Monate vor | 1

| akzeptiert

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

| akzeptiert

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

5 Monate vor | 0

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

5 Monate vor | 1

| akzeptiert

Beantwortet
I would like to create an array to store a password, website combo.
Use string array instead of cell array for efficiency. You can also considre to use table. pa = ["abc", "def"] pa = addPasswo...

5 Monate vor | 0

Beantwortet
call function with multiparameter:what is the best solution?
You could also use arguments block. doc arguments for more details. a)CaricoSistemi2Last_Struct(Settings) b)CaricoSistemi2Las...

5 Monate vor | 0

| akzeptiert

Mehr laden