필터 지우기
필터 지우기

Adding DataTipRows - I can't set VALUE of new DataTipRows

조회 수: 6 (최근 30일)
Muhammed Talu
Muhammed Talu 2020년 8월 9일
답변: Walter Roberson 2023년 3월 29일
p = trisurf(triangles,Points(:,1), Points(:,2), Points(:,3))
Now, I would like to add new DataTipRows:
>> Labels = repmat({'LL'},size(p.XData,1),size(p.XData,2)); % Creates cell array in same size with Xdata
row = dataTipTextRow('L',Labels,'auto');
p.DataTipTemplate.DataTipRows(end+1) = row;
Error using matlab.graphics.datatip.DataTipTemplate/set.DataTipRows
Value must be compatible with the data source.
>> size(triangles)
ans = 1527252 3
  댓글 수: 1
Vamsi Krishna Bandaru
Vamsi Krishna Bandaru 2023년 3월 28일
I am not sure if this qualifies as an answer, therefore i am leaving it as a comment
I got a similar error a while back and the issue was that the data type of my 'value' was single and that was not supported. when i changed it to double it worked. In your case, it might be something similar. try using a string instead of a charachter vector.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 3월 29일
The 'value' (second parameter) to dataTipTextRow must be character vector | string scalar | vector | function handle .
You cannot use the parameter to give a literal value per row. You can however specify
@(x) repmat({'LL'}, size(x))

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by