How can I set text orientation in Excel using matlab actxserver? - matlab

I'm using matlab actxserver to make a excel table. I want to change the orientation of text in a cell. I have checked some VBA codes. But I don't know how to transform a VBA command in Matlab code. I have tried:
eSheet.Range.Orientation=90;
eSheet.Range.XlOrientation=-4171;
(https://learn.microsoft.com/en-us/office/vba/api/excel.xlorientation)
(https://learn.microsoft.com/en-us/office/vba/api/excel.range.orientation)
They don't work.
What's the correct syntax to do this?

Related

Is EPS image editable

I converted a matlab fig to eps, I need to add the grid to this figure which now I have in eps format. Is there any possibility. I know I can change the title or labels using ultraedit or similar programs but cant identify the relevant place for grid.
Yes, you simply need to read the PostScript program and then modify it to be suitable for your needs.
You will, however, probably need a working knowledge of the PostScript language in order to understand the program and succesfully modify it.

MATLAB: Background color of Text in GUI

I want to use GUI (or directly the Command Windows) in MATLAB, which displays text. The text contain a few highlighted parts (which are changed during runtime), like this:
Is there any way I can do something liek that with MATLAB?
For command window you could try cprintf.
For displaying in a GUI you can use html formatting - going down this route you may find str2html useful.

Matlab figure saved as .eps appears in 'horizontal sections' when opened in Adobe Illustrator

I normally save my matlab figures as .eps and then make them better looking using Adobe Illustrator. This works for most figures but not all.
For example I plotted my data using the violin.m function from file exchange. When I save it as .eps and open it in Illustrator, I don't get an editable figure as I usually do. Instead, My figure appears chopped in horizontal sections, and all I can do is delete them (like in the figure below).
Is there anything I can do in either matlab or Illustrator to be able to edit the figure?
I don't need an .eps file, I just need to be able to edit it.
EDITS:
I tried #MattSchmatt's suggestion of using the print2eps function but I had the same problem.
Saving as .pdf doesn't solve the problem, because the image I get is not editable in Illustrator (plus, I also get the horizontal 'chunks').
A minimal, complete and verifiable example requires matlab, the violin function linked above and illustrator. But if it helps, here's the matlab code to produce a similar figure. I save by clicking on Figure -> save as. (But as I said above I tried the print2eps function and that was the same).
X = rand(100,6);
figure; violin(X)
I tried the following, didn't work either.
set(gcf, 'Renderer', 'painters')
As the author of the question suggests, I also wasn't able to export an editable (vectorized) .eps file into Illustrator. However, exporting it as .pdf does the trick. The 'fill' for the violin plots is weird, though, and has horizontal sections (perhaps something to do with the way the density estimate is being plotted?) all over. I was able to fix this and make the plots normal (with solid filled shades): select all the horizontal sections/chunks using the magic wand tool, and then increase opacity to 100% (it is set to 50 based on the exported file). Once all the required edits are made, export the file as .tiff and it seems to look fine. Hope this replicates, and thus helps! (my MATLAB version is 2016, and Illustrator version is the CS5)

Edit Text Matlab Gui

I'm writing a Gui with Guide. I have an Edit text box in it. Is it possible to write a vector instead of a single value in this box?

Add text to PDF

I've got an exported version of a MATLAB diagram, similar to the one below. The problem is, that there are no axis captions. It's not possible to export the file again from MATLAB. I need to edit the PDF programmatically and edit about 100 diagrams, all with the same axis positions.
Is there a clean and fast way to paste the Strings X and Y at the corresponding positions in the pdf based on a batch process?
Create a PDF file with the captions. Add that as a background with to the PDF files with pdftk.
if know how to use LaTeX, the pstool package can bring you far on this on, including replacing labels (or actually any text on an eps figure) with TeX symbolic expressions. Neat if you're already working in LaTeX.