Suppress Code and/or view Headings and Text in Live Editor
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm having my first go trying to write a report using MATLAB Live Editor rather than using R since I found out about a package called gramm which in my opinion does a more aesthetically pleasing job plotting than default matlab.
In R you can an .RMD file which would allow me to do what I'd like to have. In short I either want 1) The headings and text to show up in the "live view" on the right or less preferably 2) Be able to fold the code as you would in a normal script so I don't have to look at 100s of lines of code when its not in use.
I've photoshopped some quick figures to better showcase my question. The first figure is the current look
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191133/image.png)
This image is what I'd like to have (image is photoshopped)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191134/image.png)
%%create some fake input table
inputTable = array2table(rand(50,8));
% get the input size
sz = size(inputTable);
n_row = sz(1);
n_var = sz(2);
% convert inputTable into a column array
inputData = table2array(inputTable);
inputColumn = inputData(:)';
% convert variable names to a column array (do you have a Matlab version with repelem? it's great!)
variableNames = inputTable.Properties.VariableNames;
variableColumn = repelem(variableNames,n_row)';
% create x data column array
xColumn = repmat(1:n_row,1,n_var)';
% create a gramm object that is facet wrapped on the variable
f = figure('Position',[100 100 800 400]);
g = gramm('x',xColumn,'y',inputColumn,'color',variableColumn); % add the color aesthetic
g.facet_wrap(variableColumn);
g.geom_point();
g.geom_line(); % and another geometry
g.draw();
0 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!