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 8261873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:33:54+00:00 2026-06-08T03:33:54+00:00

I have a stock market data set with the following two fields: date closing_price

  • 0

I have a stock market data set with the following two fields:

  • date
  • closing_price

I would like to apply DWT on this data set and plot a graph using Matlab. Can some one please guide me how to do it..

Thank you

EDIT

here is an example set of data

Date,Open,High,Low,Close,Volume

24-Oct-03,29.12,29.2,28.93,29.16,3069600

23-Oct-03,29.5,29.69,29.34,29.55,3414200

22-Oct-03,29.95,29.95,29.49,29.65,6659700

It is CSV.

I need to plot a DWT graph where x axis is date and y axis is any one or all of the variables.

  • 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-06-08T03:33:55+00:00Added an answer on June 8, 2026 at 3:33 am

    Computing DWT

    This is actually straightforward. Use dwt to obtain the approximation and detail coefficients. For instance, a DWT using a daubechies 4-tap wavelet would be:

    [cA, cD] = dwt(X, 'db4')
    

    where X is your data.

    If each sample in X has several fields, and you want to apply the DWT just on a certain field, say X.closing_price, add square brackets:

    [cA, cD] = dwt([X.closing_price], 'db4')
    

    Note that this solution assumes that the data samples are taken at constant time intervals.
    To plot the data, you need to prepare another vector, which corresponds to the day number:

    t = 1:2:length(X);
    

    The x-axis values skips every other day because the approximation and detail coefficients vectors each have half of the samples of X.

    Demo code

    The following code generates random data and puts it into an array of structs, each element having two fields: date and closing_price:

    %# Generate some random data
    C = cell(31, 2);
    C(:, 1) = arrayfun(@(z)[num2str(z), '-Oct-03'], 1:length(C), 'Un', 0);
    C(:, 2) = num2cell(100 * randn(1, length(C)));
    X = cell2struct(C, {'date', 'closing_price'}, 2);
    

    Now, to business:

    %# Apply DWT
    [cA, cD] = dwt([X.closing_price], 'db4');
    
    %# Prepare x-axis values
    t = 1:2:length(X);
    
    %# Plot result with respect to date
    figure
    subplot(2, 1, 1), plot(t, cA)
    title('Approximation coefficients'), xlabel('day'), ylabel('C_A')
    subplot(2, 1, 2), plot(t, cD)
    title('Detail coefficients'), xlabel('day'), ylabel('C_D')
    

    This is what you should get:

    Expected result

    Hope that helps!

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

Sidebar

Related Questions

I have a MySql table with daily stock market data in the following order:
i have a task to compress a stock market data somehow...the data is in
I have some stock market data. I want to simulate the stock market by
I have a bar chart containing stock market data of the form Open, High,
I have this stock market calculator that I am working on and I searched
I have two entities STOCK(name,amount) and PC_SYSTEMS(name,c_name), and i wish to update the components
I have a timeseries of values (e.g., a random walk of stock market prices)
I have stock market application which will be frequently used by millions of members
I want to maintain last ten years of stock market data in a single
Here is the situation: I have a huge data set that I need quick

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.