フィルターのクリア

Function subsindex is not defined for values of class 'mlreportgen.dom.Image'

1 回表示 (過去 30 日間)
PromoCodeBSJ
PromoCodeBSJ 2018 年 10 月 9 日
コメント済み: PromoCodeBSJ 2018 年 10 月 10 日
Not sure what this error is trying to say as I am not indexing anything. What I am trying to do is put an image into a table and then display that table. My end goal is to create a 2x2 table filled with 4 images.
The error I get is:
Function 'subsindex' is not defined for values of class 'mlreportgen.dom.Image'.
Error in sad (line 9)
entry=TableEntry(bojack)
Here is my code:
import mlreportgen.dom.*;
import mlreportgen.report.*
rpt = Report('C:\Users\GOE7ABT\Desktop\myreport1.pdf');
bojack=Image('C:\Users\GOE7ABT\Desktop\21-bojack-12.w710.h473.jpg');
table=Table();
entry=TableEntry(bojack)
append(table,entry)
add(rpt,table)
close(rpt);
rptview(rpt.OutputPath);

採用された回答

Steven Lord
Steven Lord 2018 年 10 月 9 日
You likely have a variable named TableEntry. You may have intended your command "entry=TableEntry(bojack)" to create an instance of this class, but variables are higher in the precedence order than imported package functions. Rename or remove your variable.
  1 件のコメント
PromoCodeBSJ
PromoCodeBSJ 2018 年 10 月 10 日
Ok thank you. Now I get a different error.
Error using mlreportgen.dom.Table/append
Invalid input for argument 2 (p0):
Value must be 'mlreportgen.dom.TableRow'.
Error in sad (line 10)
append(table,entryadsfsdaf)
Does this mean I can't append the tableentry onto the table?
Code:
import mlreportgen.dom.*;
import mlreportgen.report.*
rpt = Report('C:\Users\GOE7ABT\Desktop\myreport1.pdf');
bojack=Image('C:\Users\GOE7ABT\Desktop\21-bojack-12.w710.h473.jpg');
table=Table();
entryadsfsdaf=TableEntry(bojack)
append(table,entryadsfsdaf)
add(rpt,table)
close(rpt);
rptview(rpt.OutputPath);

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by