Answered
Sliding window binning and average
Read data from csv file using readtable, suppose you store it in variable T and the two column of tables are C1 and C2. To acces...

5 years ago | 0

Answered
Customise a string and output it into a new file with x number of words per line?
it's a long method but worked for me s = 'My name is mango '; for i =1:10 s = [s s]; end x=split(s); x=reshape(x(1:15*...

5 years ago | 0

| accepted

Answered
find two minimum values not followed by each other.
The long Method A=[1;1.2;1.2;0.7;0.6;0.61;1;1;1.2;0.65]; miny = []; for i =1:3 x = min(A); A(A==x) = []; if(i~=2) ...

5 years ago | 1

Answered
Plotting different datas on the same graph smoothly
x = [1000, 2500, 5000, 7500, 10000, 25000, 50000, 75000, 100000, 250000, 500000, 750000, 1000000, 2500000, 5000000, 7500000, 100...

5 years ago | 2

Answered
Hello Everyone, How can I check if someone uploads a video in MATLAB GUI using browse button instead of uploading an image?
Try this [Filename,Pathname] =uigetfile(... {'*.png','PNG (*.png)'; '*.tif;*.tiff','TIFF (*.tif,*.tiff)'; '*.gif','GIF (*.gi...

5 years ago | 0

Answered
No-Input: Error Checking Problem
Replace your while loop conditions you are comparing z with a single character suppose someone enters z = 'abdft' the output ...

5 years ago | 0

| accepted

Answered
How to split 2*2 matrix into individual elements
x = rand(2,2); x = num2cell(x); [a,b,c,d] = deal(x{:})

5 years ago | 0

Answered
separating element in cell according to some condition
I will give you a hint for A{1}(4) with A{2} and A{3} compare 4th element of A{1} with A{2} all element if any of them is 1 it...

5 years ago | 0

Answered
How to Repeat the script and determine if user input is Binary.
regexp to find if number is between 2-9, if there exist any number, break the while loop while(1) bin = input('Enter a binary ...

5 years ago | 0

Answered
I want to plot three different values of k1 on the same graph but I don't know how to do it. k1=1.24e-6; k1=1e-6; k1=1.5e-12;
bk =[1.24e-6 1e-6 1.5e-12]; figure,hold on for i =1:length(bk) k1 = bk(i); [t,y]= ode45(dCadt,tspan,y0); plot(t,y) end

5 years ago | 0

Answered
how to read a text file line by line and store in an array
Change formatSpec from %d to %f fileID=fopen('sample.txt','r'); formatSpec='%f'; A=fscanf(fileID,formatSpec) A = 3.0...

5 years ago | 2

| accepted

Answered
How to solve "Attempted to access index 0 of an array with smaller dimension sizes.
function [y,z]= fcn(b) % b=current input PV power, %y= power fluctuation, z=smoothed output for i = 2:length(b); y = (b(i)...

5 years ago | 0

Answered
Digital Filter not Applying designed frequency response as expected
Transient Response fs=25; %25 Hz lpFilt = designfilt('lowpassiir','FilterOrder',32, ... 'PassbandFrequency',2,'Passb...

5 years ago | 0

Answered
When calling this function how is the input error caught
since you include a letter a which Matlab think is a variable. so it try to pass the variable a to testValues but that variable ...

5 years ago | 0

| accepted

Answered
Plot x axis in date format
Take this as an example T = readtable('Test.csv'); t= datetime(strrep(strrep(T.time,'T',' '),'Z','')); figure,plot(t,T.long_E...

5 years ago | 0

Answered
Plotting a plane in 3d:
%% MATRIX SPACES B4 AND AFTER ROW REDUCTION: clear ; clc ; % Create the Matrix: (matrix M) M = [3,2 ; 5,7 ; 9,1] ; ...

5 years ago | 0

| accepted

Answered
Plot data from matrix with legend name
Cells are for that purpose, see help on cell Matrix = {a, A_2, 0, 'legend entry'}; Matrix = 1×4 cell array To access m...

5 years ago | 0

| accepted

Answered
Problem in using audiowrite function
Define sampling Rate Fs = 1/0.000125; t = (0:1/Fs:0.5); b=sin(2*pi*493.88*t); d=sin(2*pi*587.33*t); d=sin(2*pi*587.33*t); ...

5 years ago | 0

Answered
hello, i want to know how to convert a maclaurin series into a table. can anyone help??
T = Maclaurin function T=Maclaurin h={'terms' 'result' 'epsilon_t' 'epsilon_a'}; n=5; x=input('enter the x value: '); eps...

5 years ago | 0

| accepted

Answered
please help me, i have the result as following , and i want save it in excel file but the code shows error
You are using command writetable and you are writing a double array either change the command from writetable to writematrix f...

5 years ago | 0

| accepted

Answered
How to smooth edges of an image with complex edges?
This Comment above I just changed the threshold condition red_comp = rbgtest(:,:,1)>rbgtest(:,:,2) & rbgtest(:,:,1)>rbgtest(...

5 years ago | 1

| accepted

Answered
How to make a 2d structure from 3d structure??
x(1,1,1) = 1; x(1,1,2) = 2; x(1,2,1) = 3; x(1,2,2) = 4; x(2,1,1) = 5; x(2,1,2) = 6; x(2,2,1) = 7; x(2,2,2) = 8; Now type...

5 years ago | 0

Answered
Plotting a complex function with function in real and imag part
figure,plot(w,real(f)) hold on,plot(w,imag(f)) or figure,plot(w,[real(x);imag(x)])

5 years ago | 0

| accepted

Answered
write a structure into the excel file not writing the structure contents
x.full_100 = rand(10,1); x.cor_thre = rand(10,1); x.full_65 = rand(10,1); x.rhib = rand(10,1); T= struct2table(x); writetab...

5 years ago | 0

Answered
Defining an array dependant on multiple user inputs
1. Using Livescript Menu1 = "A";%these are drop down menu from live script Menu2 = "A";%these are drop down menu from live scr...

5 years ago | 0

Answered
Code for filtering through elements of an array depending on criteria?
Use of switch case is better Mode1 = 'A'; % can be B C D Mode2 = 'A'; % can be B C D Mode3 = 'A'; % can be B C D Mode4 = 'A'...

5 years ago | 0

Answered
Import Several txt files [Error: Getting only first line of first file]
Replace csvread with readmatrix Data = readmatrix(aFile);

5 years ago | 0

Answered
WHich loops or command should i use in order to plot this equation? It has 3 variables: v,x,t
define x,t of same length i.e. select a sampling rate fs = 10;%Hz Now define time t = 0:1/fs:100-1/fs; x = linspace(0,2*pi,...

5 years ago | 1

Answered
A is less than a threshold
Because in your code s_dark(x,y)=A(x,y)^e; suppose A(x,y) = 0.47; where e = 0.5; 0.47^0.5 ans = 0.6856 That is wh...

5 years ago | 0

| accepted

Answered
Legend in a Graph
figure,plot(data_x,data_y,'.-','MarkerSize',10)

5 years ago | 0

Load more