LaTeX forum ⇒ Graphics, Figures & Tables!Undefined control sequence Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
biswa263
Posts: 2
Joined: Sun Oct 09, 2016 10:55 am

!Undefined control sequence

Postby biswa263 » Sun Oct 09, 2016 12:27 pm

Why do I keep getting the error "Undefined control sequence" on running the MWE given below ???

  1. \documentclass[journal,12pt,draftclsnofoot,onecolumn]{IEEEtran}
  2. \usepackage{amsmath}
  3. \usepackage{cite}
  4. \usepackage{multirow}
  5. \usepackage{multicol}
  6. \begin{document}
  7. \begin{table}[h!]
  8. \centering
  9. \caption{Optimized Parameter Values}
  10. \renewcommand{\arraystretch}{1}
  11. \scalebox{1}
  12. {
  13. \begin{tabular}{|p{2.5cm}|p{1.5cm}|p{1cm}|p{1cm}|p{2cm}|p{1.5cm}|p{1.5cm}|}
  14. \multicolumn{7}{}{} \\ \hline
  15. Type of Controller & Parameter & Xmax & Xmin & Iter. reqd. for convergence & Optimized value & $Wmin$ \\ \hline
  16. \multirow{6}{*}{PSO-SOSMC} & $c_1$ & 5 & 0.1 & 37 & 4.75& 68.43 \\ \cline{2-7}
  17. & $c_2$ & 5 & 0.1 & 10 & 4.273& 20.45 \\ \cline{2-7}
  18. & $\lambda_1 $& 5 & 0.1 & 37 & 2.75 & 68.43\\ \cline{2-7}
  19. & $\lambda_2 $& 5 & 0.1 & 10 & 3.59 & 20.45\\ \cline{2-7}
  20. & $W_1 $& 1 & 0.05 & 37 & 0.43 & 68.45\\ \cline{2-7}
  21. & $W_2 $& 1 & 0.05 & 10 & 0.218 & 20.43\\ \hline
  22. \multirow{4}{*}{PSO-BELBIC} & $W_1$ & 5 & 0.1 & 36 & 4.5 & 27.34 \\ \cline{2-7}
  23. & $W_2$ & 5 & 0.1 & 14 & 4.5 & 61.63 \\ \cline{2-7}
  24. & $G_1$ & 5 & 0.1 & 36 & 1.4 & 27.34 \\ \cline{2-7}
  25. & $G_2$ & 5 & 0.1 & 14 & 1.4 & 61.63\\ \hline
  26. \end{tabular}
  27. }
  28. \label{optimized_values}
  29. \end{table}
  30. \end{document}


It seems I might have missed out a package but not being able to identify it. Please help.

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 8539
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sun Oct 09, 2016 12:53 pm

Welcome to the forum!

Yes, you need to load the graphicx package:

\usepackage{graphicx}

Stefan
Site admin

User avatar
Johannes_B
Site Moderator
Posts: 3586
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun Oct 09, 2016 12:58 pm

scalebox is defined by package graphicx, but you don't even need it. I would suppose a different approach to tables, though. Keep it simple.

  1. \documentclass[journal,12pt,draftclsnofoot,onecolumn]{IEEEtran}
  2. \usepackage{amsmath}
  3. \usepackage{cite}
  4. %\usepackage{graphicx} %unneeded
  5. \usepackage{multirow} %unneeded
  6. %\usepackage{multicol} %unneeded
  7. \usepackage{showframe}
  8. \usepackage{booktabs}
  9. \begin{document}
  10. \begin{table}%[h!]
  11. \centering
  12. \caption{Optimized Parameter Values}
  13. \begin{tabular}{llllp{7em}p{7em}l}
  14. \toprule
  15. Type of Controller & Parameter & Xmax & Xmin & \raggedright Iter. reqd. for convergence & Optimized value & $W_\mathrm{min}$ \\ \midrule
  16. PSO-SOSMC & $c_1$ & 5 & 0.1 & 37 & 4.75 & 68.43 \\
  17. & $c_2$ & 5 & 0.1 & 10 & 4.273 & 20.45 \\
  18. & $\lambda_1 $ & 5 & 0.1 & 37 & 2.75 & 68.43\\
  19. & $\lambda_2 $ & 5 & 0.1 & 10 & 3.59 & 20.45\\
  20. & $W_1 $ & 1 & 0.05 & 37 & 0.43 & 68.45\\
  21. & $W_2 $ & 1 & 0.05 & 10 & 0.218 & 20.43\\ \cmidrule(lr){2-7}
  22. PSO-BELBIC & $W_1$ & 5 & 0.1 & 36 & 4.5 & 27.34 \\
  23. & $W_2$ & 5 & 0.1 & 14 & 4.5 & 61.63 \\
  24. & $G_1$ & 5 & 0.1 & 36 & 1.4 & 27.34 \\
  25. & $G_2$ & 5 & 0.1 & 14 & 1.4 & 61.63\\ \bottomrule
  26. \end{tabular}
  27.  
  28. \vspace{2cm}
  29. % \scalebox{1}
  30. % {
  31. \begin{tabular}{|p{2.5cm}|p{1.5cm}|p{1cm}|p{1cm}|p{2cm}|p{1.5cm}|p{1.5cm}|}
  32. \multicolumn{7}{}{} \\ \hline
  33. Type of Controller & Parameter & Xmax & Xmin & Iter. reqd. for convergence & Optimized value & $Wmin$ \\ \hline
  34. \multirow{6}{*}{PSO-SOSMC} & $c_1$ & 5 & 0.1 & 37 & 4.75& 68.43 \\ \cline{2-7}
  35. & $c_2$ & 5 & 0.1 & 10 & 4.273& 20.45 \\ \cline{2-7}
  36. & $\lambda_1 $& 5 & 0.1 & 37 & 2.75 & 68.43\\ \cline{2-7}
  37. & $\lambda_2 $& 5 & 0.1 & 10 & 3.59 & 20.45\\ \cline{2-7}
  38. & $W_1 $& 1 & 0.05 & 37 & 0.43 & 68.45\\ \cline{2-7}
  39. & $W_2 $& 1 & 0.05 & 10 & 0.218 & 20.43\\ \hline
  40. \multirow{4}{*}{PSO-BELBIC} & $W_1$ & 5 & 0.1 & 36 & 4.5 & 27.34 \\ \cline{2-7}
  41. & $W_2$ & 5 & 0.1 & 14 & 4.5 & 61.63 \\ \cline{2-7}
  42. & $G_1$ & 5 & 0.1 & 36 & 1.4 & 27.34 \\ \cline{2-7}
  43. & $G_2$ & 5 & 0.1 & 14 & 1.4 & 61.63\\ \hline
  44. \end{tabular}
  45. % }
  46. \label{optimized_values}
  47. \end{table}
  48. \end{document}


Crosspost
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

biswa263
Posts: 2
Joined: Sun Oct 09, 2016 10:55 am

Postby biswa263 » Sun Oct 09, 2016 1:19 pm

Thank You Stefan. Your idea worked really well.

Johannes, my apologies for the crosspost. I wouldn't mind if you take it down anyway.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests