Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
Vue Injector 3.3
Spectrum Analyzer pro Live 2019
Devart Excel Add-in for HubSpot 2.1
RentALLScript - Airbnb clone 2.2
SuiteCRM Theme Customization 7.11.6
iScripts NetMenus 3.1
iScripts EasyIndex 2.2
iScripts EasySnaps 2.0
Australia MyPost shipping For Magento 2 1.0.0
Australia Post eParcel For Magento 1.1.1
Source Control for SQL Server 2.0
Answers phpSoftPro 3.12
Exlcart 2.0
School College ERP 1.3.2
White-label Grocery Delivery App Solution 2.0
Top Code
iScripts EasySnaps 1
iScripts EasyIndex 1
iScripts NetMenus 2.0
ATN Site Builder 3.0
Azizi search engine script PHP 4.1.10
ATN Resume Finder 2.0
Extreme Injector 3.7
Single Leg MLM 1.2.1
IcrediBB Bulletin Board System 1.0
ICPennyBid Penny Auction Script 4.0
Invoice Manager by PHPJabbers 3.0
A beginner's guide to threading in C#
mp3-manager 1
Jango Clone Script 1.0
Aglowsoft SQL Query Tools 8.2
Top Rated
phpEnter 5.1.
Quick Maps For Dynamics CRM 3.1
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Deals and Discounts Website Script 1.0.2
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
Invoice Manager by PHPJabbers 3.0
ICPennyBid Penny Auction Script 4.0
PHP Review Script 1.0
ATN Resume Finder 2.0
ATN Site Builder 3.0
cprintf - display formatted colored text in the Command Window 1.0
File ID: 86261






cprintf - display formatted colored text in the Command Window 1.0
Download cprintf - display formatted colored text in the Command Window 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 1
Submit Rating:
cprintf - display formatted colored text in the Command Window 1.0 Description
Description:
CPRINTF processes the specified text using the exact same FORMAT arguments accepted by the built-in SPRINTF and FPRINTF functions.

CPRINTF then displays the text in the Command Window using the specified STYLE argument. The accepted styles are those used for Matlab's syntax highlighting (see: File / Preferences / Colors / M-file Syntax Highlighting Colors), and also user-defined colors.

The possible pre-defined STYLE names are:

'Text' - default: black
'Keywords' - default: blue
'Comments' - default: green
'Strings' - default: purple
'UnterminatedStrings' - default: dark red
'SystemCommands' - default: orange
'Errors' - default: light red
'Hyperlinks' - default: underlined blue

'Black','Cyan','Magenta','Blue','Green','Red','Yellow','White'

Note: styles beginning with '-' will be underlined. For example:
'-Blue' => underlined blue, like 'Hyperlinks'
'-Comments' => underlined green

STYLE also accepts a regular Matlab RGB vector, that can be negated for underlining. For example: -[0,1,1] means underlined cyan.

STYLE is case-insensitive and accepts unique partial strings just like handle property names.

Examples (see results in the attached screenshot):
cprintf('text', 'regular black text');
cprintf('hyper', 'followed %s','by');
cprintf('k', '%d colored', 4);
cprintf('-comment','& underlined');
cprintf('err', 'elementsn');
cprintf('cyan', 'cyan');
cprintf('-green', 'underlined green');
cprintf(-[1,0,1], 'underlined magenta');
cprintf([1,0.5,0],'and multi-nline orangen');

Bugs and suggestions:
Please send to Yair Altman (altmany at gmail dot com)

Warning:
This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7+, but use at your own risk!

A technical description of the implementation can be found at: http://UndocumentedMatlab.com/blog/cprintf/

See details & current limitations in the main help section

License: Shareware

Related: 039followed, s039039by039, cprintf hyper, Text, cprintf text, Regular, cprintf, colored, Elements, cprintf cyan, cprintf err, underlined, cprintf comment, Screenshot, attached, means, caseinsensitive, underlining, negated, Vector

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 1



More Similar Code

This m-file allows you to export all text in the Command Window to a cell array of strings, each entry being a line of text from the window. The unparsed raw string is also available, if desired.

Operation is very simple - this file looks for the appropriate java object in the root window and gets text from it.

I was looking for a way to do this, particularly for error tracking in some software I maintain, and nobody...



Typing the word "hi" in the command window will trigger MATLAB to randomly select one of eleven possible text responses to your greeting. Some are friendly, others are not.

This file is meant to have some fun with MATLAB. You...



Displays a string inline in the command window, overwriting any output the method previously displayed.

Useful to update any displayed string in-place, for example to indicate the the state of a simulation in progress.



These functions retrieve the last key pressed in the command window without having to explicitly wait for input. Useful for situations where code is executing and you want to poll for keyboard input but you don't want hidden figures. For example,...



setPrompt(newPrompt) sets the Command Window prompt to the specified NEWPROMPT.

NEWPROMPT can be one of the following:

- a static string: setPrompt('>> ')
=> this is the default prompt string ('>> ')



Splinedraw will let you draw a curve in the current plot by setting/deleting/moving points which are then connected by a spline. The points' coordinates are printed in the command window. Can be used to draw a trend line manually.



45%
where the completion level can be modified with subsequent calls to the function. Its usage is similar to that of WAITBAR.

PROGMETER(x, message) will create a new progress meter by displaying the string variable message and the...



Scrolling text in the window of browser.



You can rum these files by my_speech.m file, taking an value like my_speech(64, 'qam') in the command window of MATLAB.



A Gui that allow that user to change the parameters of two waves and view their summation. To launch set the Matlab path to the file location and type wave_sum in the command window.

User Review for cprintf - display formatted colored text in the Command Window
- required fields
     

Please enter text on the image