Skip to main content

Posts

Showing posts from February, 2021

Stretch the dynamic range of the given 8-bit grayscale image using MATL...

getpeaks too many input argument

  hi i have this   code     >> [x1, Fs] = wavread('chordA1.wav'); >> FFT1 = fft(x1); >> sq1 = abs(FFT1); >> sq1 = abs(FFT1); >> pks1 = getpeaks(sq1,'NPEAKS',20) when i run the the program it says ??? Error using ==> getpeaks Too many input arguments. what seems to be the problem? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. Type help getpeaks and see what it says. Or get rid of all arguments and type the left parenthesis and see what intellisense pops up to guide you. Or put the cursor in findpeaks and type control-D and it should take you to the function where you can see what arguments it allows.   By the way, you didn't i

How to know if a radio button is selected or not?

  I have one GUI with 4 Radio Buttons and one Push Putton. All of them are in one Button Group.   I want, if the user didn't select any radio button, then the Push Button will do  code -A, and if the user selected any of the radio buttons, then the Push Button will do code-B.   Any idea how to do that?   The code below is in my Push Button Function   if %user did not select any radio button, then do this else %do this if a user selected a radio button switch get(get(handles.uipanel4,'SelectedObject'),'Tag') case 'radiobutton5', line_type = 'imline'; case 'radiobutton6', line_type = 'impoint'; case 'radiobutton7', line_type = 'imfreehand'; case 'radiobutton8', line_type = 'impoly'; end   ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE,

Subscript indices must either be real positive integers or logicals.

  Hi i am getting an error in this   MATLAB code   and im not sure whats wrong with it. %define verialbe lm=0.01; Rm=0.05; Kt=1.2; Kb=4.0; B=0.25; J=10.0;   %coeff of denominator a0=((Rm/Kt)+Kb);   a1=(lm*B+Rm*J)/Kt;   a2=((lm*J)/Kt);   %define numerator and demenator num=[1]; den=[a2 a1 a0];   %define TF Gopen=tf(num,den)   % step(Gopen) The error is coming from line 24 which is Gopen=tf(num,den) so can anyone help me. ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. I cannot duplicate the error you are getting.   When I run:   %define variable lm=0.01; Rm=0.05; Kt=1.2; Kb=4.0; B=0.25; J=10.0; %coeff of denominator a0=((Rm/Kt)+Kb); a1=(lm*B+Rm*J)/Kt; a2=((lm*J)/Kt); %define

Distorted time domain signal for high pass butterworth filter designed

  Distorted time domain signal for high pass butterworth filter designed using 'butter' command and filtered using 'filter' command Why does the filtered samples of my high pass filter (12th order) look distorted in the time domain when I use the 'filter' command? The filter is designed with the butter command with a very low cut-off frequency of 0.65Hz. The frequency of the   signal  is 25Hz. ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. The butter worth filter has non-zero phase distortion characteristics which is observed in the time domain. A workaround to obtain   signals  with zero-distortions would be to use the 'filtfilt' command instead.

Finding peaks in EEG data

  I know this question has been asked a number of times, but a thorough search did not help me find an answer and as I am very new to matlab I need some help. I need to count the number of peaks in a large body of EEG data. The code below allows me to plot what the data looks like (for 1 piece of data). I need to count the really long narrow spikes.   I know there are a bunch of peakfinder functions out there but I have no idea how to use them because they are all vector based and I don't know how to reference the vectors that are preprocessed in the script (fieldtrip). A simple threshold function wouldn't work because there is a lot of overall noise that is not related to what I want to count. This is what the data looks like:   This is the script I have:     % create the trial definition cfg=[]; cfg.filename = ['I:\EEG\',SubNum{subject},'\',FolderName, GroupName, SeqNum{subject}, '_', SubNum{subject}, '_Block

How to do this more efficiently

  I have this piece of code in   MATLAB :       for kk=0:N-1 for mm=0:N-1 for pp=1:Np for qq=1:Np if ((kk*Ts+tau(pp)))<=(mm*Ts+tau(qq))) && ((kk+1)*Ts+tau(pp))>(mm*Ts+tau(qq))) thetaSR=(((kk+1)*Ts+tau(pp)))-((mm*Ts+tau(qq)))); F_SR_MR(kk+1,mm+1)=F_SR_MR(kk+1,mm+1)+conj(H(pp))*H(qq)*(thetaSR*exp(1i*pi*fc**thetaSR)*sinc(fc*thetaSR)); end which obviously is not very efficient. How can I re-write it more efficiently? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. It isn't necessary to do the inequality test for every possible pair of kk and mm values. Since kk and mm are

Are MATLAB's inbuilt functions and official toolboxes cross-platform consistent?

  I am writing some code which would be executed on different operating systems, both inside   MATLAB  and in MCR enviroment. My code does not make use of any random number generator (i.e. the algorithm is completely deterministic) and only make use of inbuilt functions and official toolboxes. I want to know if the inputs are exactly same then would the outputs generated on different platforms be exactly same? In other words, if   macOutput  and   winOutput  are output arrays on Mac and Windows platform respectively, then would following always return   true  ?   isequal(macOutput, winOutput) ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. I would like to respond to a modified ve

How to find number of times graph goes back to zero?

  Hello everyone, I am new to MATLAB and I am currently plotting a normalised gyroscope data as in the picture below, and I am trying to count the number of the graph trying to go back to zero (on the word, number of the graph descending after reaching each peak). For example, if I calculate it manually fromthe graph, it's around 9 times it tries to go back to zero. But I am trying to do analysis on big data so I really ned way of finding it by MATLAB. ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. To find the troughs, invert the   ‘y’  values and use   findpeaks :   Example:   x = linspace(0,250,250); % Create Data y = 0.25*sin(0.25*pi*x) .* exp(-(x-125).

Min and local max of a curve

  Hi I have a histogram which I want to find its min and max. So lets say the first max happens around 0.1 the local mean is at around 0.3 and second local max is at around 0.8.   I use findpeaks command but my first question is how to find a location on horizontal axis after having the index of maxima or minima? (specially for the minima and second max)?   2-How to find location of minimum because findpeaks only gives maximum location? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. The usual method is to use findpeaks on the inverted  signal , so that what were once valleys (minima) now become peaks.   flippedSignal = max(signal) - signal; By the way, what does this have to do

how i can smooth my data ?

  i want to make smoothing to my data that i   plot  here ? ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. One way to do it is to use a Savitzky-Golay filter, basically a moving/sliding polynomial fit. See the attached code, below the screenshot, for a demo.   clc; % Clear the command window. close all; % Close all figures (except those of imtool.) clear; % Erase all existing variables. Or clearvars if you want. workspace; % Make sure the workspace panel is showing. format long g; format compact; fontSize = 25; % Make a noisy sine wave signal x = 1 : 300; period = 50 y = sin(2*pi*x/period); noiseAmplitude = 0.8; y = y + noiseAmplitude * rand(size(y)) SEE COMPLETE ANSWER C

bBstatic Radar Example issues

  Trying to familiarise myself with the radar   functions , specifically the "Tracking Using Bistatic Range Detections" examples.   I keep getting errors related to some of the helper functions involved. Specifically, "helperBistaticRangeFusionDisplay is not defined for class 'helperBistaticRangeFusionDisplay' or is removed from   MATLAB's  search path." and (I believe subsequently) "Update traversal encountered invalid scene tree"     Is there some functionality here that's been removed? Or am I missing somthing. ANSWER Matlabsolutions.com  provide latest  MatLab Homework Help, MatLab Assignment Help  for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research. If you open this example using the link in the doc (which translates to th