Information and discussion about graphics, figures & tables in LaTeX documents.
biswa263
Posts: 2 Joined: Sun Oct 09, 2016 10:55 am
Post
by biswa263 » Sun Oct 09, 2016 12:27 pm
Why do I keep getting the error "Undefined control sequence" on running the MWE given below ???
Code: Select all
\documentclass[journal,12pt,draftclsnofoot,onecolumn]{IEEEtran}
\usepackage{amsmath}
\usepackage{cite}
\usepackage{multirow}
\usepackage{multicol}
\begin{document}
\begin{table}[h!]
\centering
\caption{Optimized Parameter Values}
\renewcommand{\arraystretch}{1}
\scalebox{1}
{
\begin{tabular}{|p{2.5cm}|p{1.5cm}|p{1cm}|p{1cm}|p{2cm}|p{1.5cm}|p{1.5cm}|}
\multicolumn{7}{}{} \\ \hline
Type of Controller & Parameter & Xmax & Xmin & Iter. reqd. for convergence & Optimized value & $Wmin$ \\ \hline
\multirow{6}{*}{PSO-SOSMC} & $c_1$ & 5 & 0.1 & 37 & 4.75& 68.43 \\ \cline{2-7}
& $c_2$ & 5 & 0.1 & 10 & 4.273& 20.45 \\ \cline{2-7}
& $\lambda_1 $& 5 & 0.1 & 37 & 2.75 & 68.43\\ \cline{2-7}
& $\lambda_2 $& 5 & 0.1 & 10 & 3.59 & 20.45\\ \cline{2-7}
& $W_1 $& 1 & 0.05 & 37 & 0.43 & 68.45\\ \cline{2-7}
& $W_2 $& 1 & 0.05 & 10 & 0.218 & 20.43\\ \hline
\multirow{4}{*}{PSO-BELBIC} & $W_1$ & 5 & 0.1 & 36 & 4.5 & 27.34 \\ \cline{2-7}
& $W_2$ & 5 & 0.1 & 14 & 4.5 & 61.63 \\ \cline{2-7}
& $G_1$ & 5 & 0.1 & 36 & 1.4 & 27.34 \\ \cline{2-7}
& $G_2$ & 5 & 0.1 & 14 & 1.4 & 61.63\\ \hline
\end{tabular}
}
\label{optimized_values}
\end{table}
\end{document}
It seems I might have missed out a package but not being able to identify it. Please help.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Stefan Kottwitz
Site Admin
Posts: 10324 Joined: Mon Mar 10, 2008 9:44 pm
Post
by Stefan Kottwitz » Sun Oct 09, 2016 12:53 pm
Welcome to the forum!
Yes, you need to load the graphicx
package:
\usepackage{graphicx}
Stefan
LaTeX.org admin
Johannes_B
Site Moderator
Posts: 4182 Joined: Thu Nov 01, 2012 4:08 pm
Post
by 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.
Code: Select all
\documentclass[journal,12pt,draftclsnofoot,onecolumn]{IEEEtran}
\usepackage{amsmath}
\usepackage{cite}
%\usepackage{graphicx} %unneeded
\usepackage{multirow} %unneeded
%\usepackage{multicol} %unneeded
\usepackage{showframe}
\usepackage{booktabs}
\begin{document}
\begin{table}%[h!]
\centering
\caption{Optimized Parameter Values}
\begin{tabular}{llllp{7em}p{7em}l}
\toprule
Type of Controller & Parameter & Xmax & Xmin & \raggedright Iter. reqd. for convergence & Optimized value & $W_\mathrm{min}$ \\ \midrule
PSO-SOSMC & $c_1$ & 5 & 0.1 & 37 & 4.75 & 68.43 \\
& $c_2$ & 5 & 0.1 & 10 & 4.273 & 20.45 \\
& $\lambda_1 $ & 5 & 0.1 & 37 & 2.75 & 68.43\\
& $\lambda_2 $ & 5 & 0.1 & 10 & 3.59 & 20.45\\
& $W_1 $ & 1 & 0.05 & 37 & 0.43 & 68.45\\
& $W_2 $ & 1 & 0.05 & 10 & 0.218 & 20.43\\ \cmidrule(lr){2-7}
PSO-BELBIC & $W_1$ & 5 & 0.1 & 36 & 4.5 & 27.34 \\
& $W_2$ & 5 & 0.1 & 14 & 4.5 & 61.63 \\
& $G_1$ & 5 & 0.1 & 36 & 1.4 & 27.34 \\
& $G_2$ & 5 & 0.1 & 14 & 1.4 & 61.63\\ \bottomrule
\end{tabular}
\vspace{2cm}
% \scalebox{1}
% {
\begin{tabular}{|p{2.5cm}|p{1.5cm}|p{1cm}|p{1cm}|p{2cm}|p{1.5cm}|p{1.5cm}|}
\multicolumn{7}{}{} \\ \hline
Type of Controller & Parameter & Xmax & Xmin & Iter. reqd. for convergence & Optimized value & $Wmin$ \\ \hline
\multirow{6}{*}{PSO-SOSMC} & $c_1$ & 5 & 0.1 & 37 & 4.75& 68.43 \\ \cline{2-7}
& $c_2$ & 5 & 0.1 & 10 & 4.273& 20.45 \\ \cline{2-7}
& $\lambda_1 $& 5 & 0.1 & 37 & 2.75 & 68.43\\ \cline{2-7}
& $\lambda_2 $& 5 & 0.1 & 10 & 3.59 & 20.45\\ \cline{2-7}
& $W_1 $& 1 & 0.05 & 37 & 0.43 & 68.45\\ \cline{2-7}
& $W_2 $& 1 & 0.05 & 10 & 0.218 & 20.43\\ \hline
\multirow{4}{*}{PSO-BELBIC} & $W_1$ & 5 & 0.1 & 36 & 4.5 & 27.34 \\ \cline{2-7}
& $W_2$ & 5 & 0.1 & 14 & 4.5 & 61.63 \\ \cline{2-7}
& $G_1$ & 5 & 0.1 & 36 & 1.4 & 27.34 \\ \cline{2-7}
& $G_2$ & 5 & 0.1 & 14 & 1.4 & 61.63\\ \hline
\end{tabular}
% }
\label{optimized_values}
\end{table}
\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
Post
by 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.