Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3243832
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:28:46+00:00 2026-05-17T18:28:46+00:00

I am about to present my work that I have created in MATLAB, but

  • 0

I am about to present my work that I have created in MATLAB, but I am having trouble manipulating my data into a presentable form using the plot function.

My code looks like this:

[inputname, pathname] = uigetfile('*.wav', 'Select WAV-file');

thumb1 = inputname;               %# Get filename information
fprintf('\n%s is being turned into a 30s thumbnail...\n', thumb1);
fprintf('Please wait..!\n\n');
%# load the signal
[y, fs, nb] = wavread(thumb1);
y = mean(y,2);                               %# stereo, take avrg of 2 channels

%# Calculate frame energy
fWidth = round(fs*10e-3);                    %# 10ms
numFrames = floor(length(y)/fWidth);
energy = zeros(1,numFrames);
for f=1:numFrames
  energy(f) = sum( y((f-1)*fWidth+1:f*fWidth).^2 );
end

Basically I want to plot the energy of the track over time (in seconds).

plot(energy)

nearly does what I require, but I have an unusual amount of blank space at the end of the track which is not present in the .wav filealt text. This blank space is the main issue that I’m having. Ideally I would like the x axis to be displayed in seconds! Any help would be much appreciated.

edit1:

Using the first suggested method:

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:28:46+00:00Added an answer on May 17, 2026 at 6:28 pm

    There’s also

    axis tight
    

    which sets “tight” limits for the axis. See doc: http://www.mathworks.com/help/techdoc/ref/axis.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had read somewhere about one specific feature that is present in awk but
I have a question about how to present some structured data using HTML. I
I have a Linq-2-XML query that will not work if a google sitemap that
I have a program that checks if a file is present every 3 seconds,
I have been working on a project which is about data copy from one
I have create an IOS app. The app has MainViewController that will present/dismiss Modal
I have an older form that I really don't want to rewrite at this
I have a customer service web app requirement, which requires that I work pull
I have a question about remote threads.I've read Mike Stall's article present here: <
I'm a novice, so I guess in the code I'm about to present, ther're

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.