About 570,000 results
Open links in new tab
  1. How can I use a string in legend ()? - MATLAB Answers - MathWorks

    How can I use directly the string Legend, without copying it to the function legend()?

  2. legend - Add legend to axes - MATLAB - MathWorks

    Specify the labels as a list of character vectors or strings, such as legend('Jan','Feb','Mar'). example legend( labels ) sets the labels using a cell array of character vectors, a string array, …

  3. Legend with text and values of array - MATLAB Answers

    Oct 6, 2019 · You can pass an cell array of strings to the legend() (here for documentation https://de.mathworks.com/help/matlab/ref/legend.html) function in order to have what you …

  4. How to use string for a graph legend - MATLAB Answers

    Jul 14, 2016 · Instead of concatenating strings using the cellstr(attribute) function finally worked for me. Index increments by one for every file, fLogName is the name of the file and …

  5. Create Legend From Array - MATLAB Answers - MATLAB Central

    Dec 19, 2017 · In the first two codes, legendCell is a cell array of cells ( = {{..} {...}} ) rather than a cell array of strings (= {'..' '..'})! You have a pair of curly braces too many, as cellstr creates a …

  6. Creating legend based on numeric array - MATLAB Answers

    Aug 1, 2011 · Creating legend based on numeric array. Learn more about string manipulation MATLAB I have a numeric array, for example: N = [1 7 14 30 90 180 360]; I want to create a …

  7. Adding variable values into legend - MATLAB Answers - MathWorks

    Apr 25, 2023 · The legend call wants one plotted object (line, marker, etc.) for each item in it, and will complain if there are more legend items than plotted objects. In that context, the text call is …

  8. How can I add both numbers and text as legend in a plot?

    Dec 4, 2013 · I have a matrix called x, which contains 8 numbers. I have then a plot, and I can get the numbers as legend by writing legend(num2str(x(1)),.....), but I also want one letter after …

  9. How can one show variable values in legend of a plot?

    May 29, 2020 · hLg=legend(legends); saves generating and having to use sequentially-named variables and the need to edit all of them in case something changes. This way all the edits …

  10. Add Legend to Graph - MATLAB & Simulink - MathWorks

    Legends are a useful way to label data series plotted on a graph. These examples show how to create a legend and make some common modifications, such as changing the location, setting …

Refresh