Risposto
Plotting audio signal with number of samples
% Read all data [x,fs]=audioread('Song.wav'); t = (0:length(x)-1)/fs; %t=linspace(0,length(x)/fs,length(x)); plot(t,x) xlab...

oltre 2 anni fa | 0

Risposto
How to Display Data in Table
v = (0:5:50)'; % use a column here a_n=(-0.01.*(v+50))./(exp(-(v+50)./10)-1); b_n= exp(-(v+60)./80)./8; a_m = (-.1.*(v+35))....

oltre 2 anni fa | 0

| accettato

Risposto
not compatible with the size
itr=0; % number of iteration for t=1:1:3 itr=itr+1; b(itr, :)=[sin(t) cos(t)]; % Two numbers for each iterat...

oltre 2 anni fa | 0

| accettato

Risposto
Gives the specific parameter value as set of value instead one value.
[Pgrid, Rgrid] = meshgrid(2:30, 6:25); % all combinations of P and R values z = zeros(size(Pgrid)); for i=1:size(Pgrid, 1...

oltre 2 anni fa | 1

Risposto
problem in drawing the frequency spectrum of frequency modulated signal in matlab
fs=100000; %sampling frequency ts = 1/fs ; % time interval between sample point t = 0 : ts :0.02; % scale of time, maximu...

oltre 2 anni fa | 0

| accettato

Risposto
How to do Gaussian Filter 1D?
x = readtimetable("IAGA Daily Magnetic Data (1m) Extraction 04-Jul-2021 (CTS).txt") w = gausswin(10, 2.5); w = w/sum(w); ...

oltre 2 anni fa | 0

| accettato

Risposto
How to save the accuracy and loss of every batch in deep learning?
Check out the "train" command you use. For example "doc train". You can include the train record as your output such as: [tra...

oltre 2 anni fa | 0

| accettato

Risposto
Help adding external functions
MATLAB has no external function like c and other languages. It relies on "path" to figure out the external functions. You can ...

oltre 2 anni fa | 0

Risposto
convert code from excel to matlab
% x = IF(AND(2*abs(d)>3*abs(l-n), 2*abs(d)>3*abs(r-n)), 2*abs(d), IF(3*abs(l-n)>3*abs(r-n), 3*abs(l-n), 3*abs(r-n))) if (2*abs(...

oltre 2 anni fa | 0

Risposto
Avoid Displaying the data simultaneously in the command window
Yes. You can suppress the display in command window, which also speed up your program when a lot of data is to be displayed: *...

oltre 2 anni fa | 1

| accettato

Risposto
Custom equation error in fitting toolbox
The following function will result in undefined value for sin(x)=0 sin(a*sin(x))/(a*sin(x)) You can change this into sinc func...

oltre 2 anni fa | 0

| accettato

Risposto
Display values on plot
You can use text. For example t = 0:.01:2*pi; x = cos(t); plot(t, x); text(0.2, 0.4, {'This', 'is', 'a', 'test'}, 'EdgeColo...

oltre 2 anni fa | 0

| accettato

Risposto
Simple way to "shrink" the dashes on a line
Try this: https://www.mathworks.com/matlabcentral/fileexchange/1892-dashline

oltre 2 anni fa | 0

Risposto
Problem using 'dlmwrite' into .txt file which contains 19/20 digit intergers
MATLAB double data type cannot hold so many digits in your imput data. It will round off the data to what-so-ever a double type...

oltre 2 anni fa | 0

| accettato

Risposto
Write a function called minmax
minimax(randn(4,4)); function [x, y] = minimax(A) x = max(A(:)); % use colon here to find the max of all elements in 2d...

oltre 2 anni fa | 1

| accettato

Risposto
Selecting numbers ending in a specific digit from a matrix
% Assume the numbers are integers x = randi([-2000,2000], 100, 1); % The number end with 4 or 9 x1 = mod(abs(x), 10); idx = ...

oltre 2 anni fa | 0

| accettato

Risposto
How to make narrow band noise
cf1 = 2000; % central fq bw = 0.25; % bandwidth in octave low_f1 = cf1 / 2 ^ (bw/2); % lower limit of th...

oltre 2 anni fa | 0

| accettato

Risposto
How to change markers on axes to be on the opposite side and how to add more markers in between that are smaller
plot(rand(20,3)) h=gca; h.XMinorTick = 'on'; h.TickDir = 'out';

oltre 2 anni fa | 0

Risposto
Ho to find peaks at step graphs?
Try to "detrend" the data first; then apply "findpeaks".

oltre 2 anni fa | 0

Risposto
How to do running another .m file that calls this .m file?
Save the followint into a file, for example, 'my_script.m': x = [5 10 12 3]; y = [11 8 3 3]; plot(x,y, 'g') In a separate sc...

oltre 2 anni fa | 0

Risposto
Convert Python code to Matlab code
% create some files for testing writematrix([3 4], 'test1.txt'); writematrix([5 6], 'test2.txt'); dir folder_path = ''; c...

oltre 2 anni fa | 1

| accettato

Risposto
Count word except some special case
x ='some text here with a and an and the'; % you can use "lower" to convert it into lower case % % consider "split" to split ...

oltre 2 anni fa | 1

Risposto
How to convert point plot to line plot?
Fp = 1000; %Bandpass Freq Fs = 2000; %BandStop Freq SF = 10000; %Sampling Freq Pr = 0.1; %Passband ripple Sr = 0.001; %S...

oltre 2 anni fa | 0

| accettato

Risposto
how to use a while loop for switch case
repeat = true; while repeat transactionType= input('1:withdraw 2:deposit 3:account balance 4:end use'); repeat = fals...

oltre 2 anni fa | 0

Risposto
Can someone help me understand this code?
[throwAgain, RV]=MCO_throwAgain() function [throwAgain, RV]=MCO_throwAgain() % MCO_throwAgain outputs the number of random thr...

oltre 2 anni fa | 1

Risposto
How do I use a loop to remove all of the noise signal segments?
load signal % detect the env y = sqrt(2)* movstd(x, [200 200]); figure plot(x); hold on plot(y) % extract signal z...

oltre 2 anni fa | 0

Risposto
Inputting Date Time data and presenting as a graph
A = readtimetable('08_underwater.csv') A.Properties.VariableNames{1} = 'Light'; plot(A.Datetime,A.Light)

oltre 2 anni fa | 0

Risposto
How to identify the hourly/daily missing data points?
% Assume you have the observation as a datenum vector % Here we generate an example datenum vector observation = datenum(2021,...

oltre 2 anni fa | 0

| accettato

Risposto
FUNCTION shift of vector's position
Here is some pseudo code: %1. Let the vector index be idx = (0:n-1) + 1 %2. When rotating to right by "shift" (which can be ...

oltre 2 anni fa | 0

Risposto
how to create an input window for more than two variables
prompt = {'r1','r2','r3','r4','o2','o2p','o2pp'}; dlgtitle = 'input'; dims = [1, 35]; answer = inputdlg(prompt,dlgtitle,dims)...

oltre 2 anni fa | 0

Carica altro