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

4 years ago | 0

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

4 years ago | 0

| accepted

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

4 years ago | 0

| accepted

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

4 years ago | 1

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

4 years ago | 0

| accepted

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

4 years ago | 0

| accepted

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

4 years ago | 0

| accepted

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

4 years ago | 0

Answered
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(...

4 years ago | 0

Answered
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: *...

4 years ago | 1

| accepted

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

4 years ago | 0

| accepted

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

4 years ago | 0

| accepted

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

4 years ago | 0

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

4 years ago | 0

| accepted

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

4 years ago | 1

| accepted

Answered
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 = ...

4 years ago | 0

| accepted

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

4 years ago | 0

| accepted

Answered
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';

4 years ago | 0

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

4 years ago | 0

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

4 years ago | 0

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

4 years ago | 1

| accepted

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

4 years ago | 1

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

4 years ago | 0

| accepted

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

4 years ago | 0

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

4 years ago | 1

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

4 years ago | 0

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

4 years ago | 0

Answered
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,...

4 years ago | 0

| accepted

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

4 years ago | 0

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

4 years ago | 0

Load more