Resolve: "Dot indexing is not supported for variables of this type."

4 次查看(过去 30 天)
Hi
I am using MATLAB online. I am getting the following error
Warning: The JavaFrame figure property will be removed in a future release. For more information see UI Alternatives for MATLAB Apps on mathworks.com. > In rawDataReader>initDisplayPage (line 714)
In rawDataReader (line 165)
Dot indexing is not supported for variables of this type.
Error in rawDataReader>initDisplayPage (line 716)
jframe.setFigureIcon(jIcon);
Error in rawDataReader (line 165)
ui.figHandle = initDisplayPage(setupJSON.mmWaveDevice);
Here is the code in line 165 of rawDataReader
ui.figHandle = initDisplayPage(setupJSON.mmWaveDevice);
"setupJSON" variable is created using below line
setupJSON = jsondecode(fileread('2024_July_07_setup.setup.json'));
Here is the content of file '2024_July_07_setup.setup.json'
{
"createdByVersion": "2.1.0",
"createdOn": "2024-07-07T11:52:19.6750601+05:30",
"configUsed": "./data_and_related_files/2024_July_07_mmWave.mmwave.json",
"captureHardware": "DCA1000",
"DCA1000Config": {
"dataLoggingMode": "raw",
"dataTransferMode": "LVDSCapture",
"dataCaptureMode": "ethernetStream",
"packetSequenceEnable": 1,
"packetDelay_us": 25
},
"mmWaveDevice": "awr1843",
"operatingFreq": 77,
"mmWaveDeviceConfig": {
"RS232COMPort": "COM9",
"RS232BaudRate": "921600",
"radarSSFirmware": "xwr18xx_radarss.bin",
"masterSSFirmware": "xwr18xx_masterss.bin"
},
"capturedFiles": {
"numFilesCollected": 1,
"fileBasePath": "./data_and_related_files",
"files": [
{
"rawFileName": "adc_data_Raw_0.bin",
"processedFileName": "2024_July_07_adc_data_256Samples_128Loops_1000Frames.bin",
"processedFileSummary": {
"numZeroFillBytes": 0
}
}
]
}
}
How to resolve this error

回答(1 个)

Catalytic
Catalytic 2024-7-8
You need to stop the code at rawDataReader>initDisplayPage (line 716) and examine what type of variable jframe is. According to the error message, you will find that it is not a type of variable for which 'jframe.setFigureIcon' makes sense.
  2 个评论
Palguna Gopireddy
编辑:Palguna Gopireddy 2024-7-8
The "jframe" variable is formed like this.
function [figHandle] = initDisplayPage(platformType)
global ui
%Setup the main figure
figHandle = figure(1);
clf(figHandle);
set(figHandle,'Name',strcat('Texas Instruments mmWave device - ', upper(platformType), ' Post Processing Tool'),'NumberTitle','off');
warning off MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame
jframe=get(figHandle,'javaframe');
jIcon=javax.swing.ImageIcon('texas_instruments.gif');
jframe.setFigureIcon(jIcon);
So I think "jframe" variable is used in plotting.
I am able to run the program by just commenting the line
%jframe.setFigureIcon(jIcon);
Didn't need to stop the code. The program is showing some plots like below and the program is running until the stop button is pressed. I think the plots are running java.
But still this waring is appearing
Warning: The JavaFrame figure property will be removed in a future release. For more information see UI Alternatives for MATLAB Apps on mathworks.com. > In rawDataReader>initDisplayPage (line 714)
In rawDataReader (line 165)
Never plotted something likethis using java in MATLAB. I searche matlab documents and forum. Found that it is used to replace the figure icons. How to replace MATLAB icon from a figure window? - MATLAB Answers - MATLAB Central (mathworks.com)
I think this dot indexing error is appeaing because of "jframe.setFigureIcon(jIcon)", I thought because of "ui.figHandle = initDisplayPage(setupJSON.mmWaveDevice);"
still like to know what caused this error. (I am using MATLAB online)
Keshav
Keshav 2024-7-12
编辑:Keshav 2024-7-12
Hi,
You are receiving the error message "Dot indexing is not supported for variables of this type" because the variable "jframe" in your code is an empty array.
The following code is returning an empty array in MATLAB Online.
get(figure(1), 'javaframe')
As a result, the variable "jframe" is an empty array, and you cannot access any properties of an empty array.
I hope the above explanation answers your query.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by