필터 지우기
필터 지우기

Add Text Subscript to Table string

조회 수: 19 (최근 30일)
Luck Haviland
Luck Haviland 2022년 9월 28일
편집: Luck Haviland 2022년 9월 28일
Hello:
Say I have a composite.
The composite has a layup [0 90 0 90 0_8]
I am trying to output this layup into a table using the table() function. This is my current output:
Example="[0 90 0 90 0 90 0_8]"
Example = "[0 90 0 90 0 90 0_8]"
T=table(Example,'RowName',"Layup Orientation")
T = table
Example ______________________ Layup Orientation "[0 90 0 90 0 90 0_8]"
I want the 8 to be a subscript on the 0. How do I do this?
Thank you very much,
Luck

답변 (1개)

Steven Lord
Steven Lord 2022년 9월 28일
You don't. The text in the table doesn't have any sort of formatter or interpreter associated with it; it's a collection of characters.
If you were to specify that as the appropriate property of a Handle Graphics object, an object with something like an Interpreter property, you could tell it to interpret the string differently when that object displays it. For instance, a plot's Title is a text object with an Interpreter property.
title("[0 90 0 90 0 90 0_8]", 'Interpreter', 'Tex')
  댓글 수: 1
Luck Haviland
Luck Haviland 2022년 9월 28일
편집: Luck Haviland 2022년 9월 28일
Hi Steven, this is very good to know. It appears to me that table does not have an "Interpreter" option. If it does not have this option I would like to formally request this option to be implemented into the table() function.
I have looked across the internet a little bit and I have found several functions that use the 'Interpreter' handle. However, the ones I have found all seem to be used for plots, not tables.
I have tried wonky methods such as:
Example=text(0,0,"[0 90 0 90 0 90 0_8]",'Interpreter','Tex')
Example =
Text ([0 90 0 90 0 90 0_8]) with properties: String: '[0 90 0 90 0 90 0_8]' FontSize: 10 FontWeight: 'normal' FontName: 'Helvetica' Color: [0 0 0] HorizontalAlignment: 'left' Position: [0 0 0] Units: 'data' Show all properties
table(Example,'RowNames',"Layup Orientation")
ans = table
Example __________________________________ Layup Orientation 1×1 matlab.graphics.primitive.Text
I also tried the set() function, but it is says it is not compatible with the table() function. I also messed around with the varfun() function, but it did not appear to work either. However, I have never used the varfun() function before, so maybe it would work if played with enough.
TL;DR: My methods did not work. I need more help please.
Thank you,
Luck

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Assembly에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by