fontsize4rowsfullHD

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-11, Last change: 2025-09-15

font size for lectures and video recording on 25 lines

Description

similar to clcl
s=settings; s.matlab.fonts.codefont.Size.PersonalValue=fs;


See Also:

Example Illustration

 missing image of fontsize4rowsfullHD(rows)

Syntax

fs=fontsize4rowsfullHD([rows])

Input Parameter

rows: 25 or 40 rows; default is 25

Output Parameter

fs: fontsize

Examples


fontsize4rowsfullHD(25)
fontsize4rowsfullHD(40)




Copyright 2022-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, fontsize4rowsfullHD, calculates the font size for displaying code in MATLAB based on the number of rows that fit on a Full HD screen. It is part of the SolidGeometry library and was introduced in version 5.1.

Input Parameters

Output

Algorithm Steps

  1. The function begins by determining the number of rows using getfuncparams, which retrieves the first argument from varargin or defaults to 25 if not provided.
  2. It retrieves the screen size using get(0,'ScreenSize'), although this value is not directly used in the final calculation.
  3. The font size fs is calculated using the formula floor((1080)/(2*rows)). This formula assumes a screen height of 1080 pixels (Full HD) and divides it by twice the number of rows to determine the font size.
  4. The calculated font size is then set as the personal value for MATLAB's code font size using the settings object.

Example Usage

To calculate the font size for 25 rows:

fontsize4rowsfullHD(25)

To calculate the font size for 40 rows:

fontsize4rowsfullHD(40)
Algorithm explaination created using ChatGPT on 2025-08-18 23:25. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21