• Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Special Offers
Business Intelligence Info
  • Business Intelligence
    • BI News and Info
    • Big Data
    • Mobile and Cloud
    • Self-Service BI
  • CRM
    • CRM News and Info
    • InfusionSoft
    • Microsoft Dynamics CRM
    • NetSuite
    • OnContact
    • Salesforce
    • Workbooks
  • Data Mining
    • Pentaho
    • Sisense
    • Tableau
    • TIBCO Spotfire
  • Data Warehousing
    • DWH News and Info
    • IBM DB2
    • Microsoft SQL Server
    • Oracle
    • Teradata
  • Predictive Analytics
    • FICO
    • KNIME
    • Mathematica
    • Matlab
    • Minitab
    • RapidMiner
    • Revolution
    • SAP
    • SAS/SPSS
  • Humor

Tag Archives: SetDelayed

Unknown and slow behavior of a SetDelayed manipulate

October 18, 2016   BI News and Info
 Unknown and slow behavior of a SetDelayed manipulate

I couldn’t find much info about this problem so jumping right in: I have a large data matrix that I wish to select parts of and view in real-time using manipulate. But in coding it up I’ve found some odd behavior of manipulate when I try to make a function out of it using SetDelayed. For example, the following code works very quickly and presumably as intended:

rawdata = Table[{i, i + 1, i + 2}, {i, 100000}];
Manipulate[rawdata[[y;y+200]], {y, 500}]

The data matrix I’m using is about as large, but ordinarily there would be more selection criteria than a single element–however not an unreasonably complicated selection process: only a few criteria using one iteration of Cases[] for particular numeric values.

In any case, the aberrant behavior appears in this toy example when I wish to define the manipulate as a function for more general use (ultimately for use in a package):

displaydata[rawdatavar_] := Manipulate[rawdatavar[[y;;y+200]], {y, 500}]
displaydata[rawdata]

This second example takes 0.14s compared to the previous 0. In this specific example the evaluation time is short enough to not be too problematic but nevertheless demonstrates the strange behavior. With my real data however, despite only a difference of non-integer matrix elements and a use of Cases[] which separately behaves quickly, the evaluation time can be in tens of seconds or minutes.

Any insight or resources would be greatly appreciated. I am still somewhat a Mathematica novice so forgive me if this is a simple problem with the implementation of SetDelayed, but based on the documentation for Manipulate[] this should be valid.

edit* Some interesting results: I’ve found that timing my minutes-long evaluation (using real data) only results in a 0.14 s duration. The rest of the time is apparently rendering the output. This is further explained because I get a temporary prompt window displaying “Formatting Notebook Contents”. This appears to be the real problem–again any insight would be greatly appreciated.

Let’s block ads! (Why?)

Recent Questions – Mathematica Stack Exchange

Read More
  • Recent Posts

    • GIVEN WHAT HE TOLD A MARINE…..IT WOULD NOT SURPRISE ME
    • How the pandemic is accelerating enterprise open source adoption
    • Rickey Smiley To Host 22nd Annual Super Bowl Gospel Celebration On BET
    • Kili Technology unveils data annotation platform to improve AI, raises $7 million
    • P3 Jobs: Time to Come Home?
  • Categories

  • Archives

    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
© 2021 Business Intelligence Info
Power BI Training | G Com Solutions Limited