Hi,
So I was running the below code and I keep getting the message:
"char object
Properties:
Dot indexing is not supported for variables of this type.
Error in disp (line 34)
name=visible(name,object.ConcealedProperties);
Error in PlotSpecAndHistory (line 7)
disp('SELECT SPECTROGRAM BINARY FILE');"
So to read on disp I used the help function in the command window and then received a similar error, as I assume help also uses disp. Does anyone have any knowledge of why this might be happening? Thanks!
Edit: This same error also occurs when calling 'plot'
% start fresh
close all; clear; clc% Choose the Spectogram file using a GUI
disp('SELECT SPECTROGRAM BINARY FILE');[SFile,SPath] = uigetfile('*','Select Spectrogram Binary File','Spectrogram.mat');if isequal(SFile,0) disp('SPECTROGRAM: User selected Cancel');else disp(['SPECTROGRAM: User selected "', fullfile(SPath,SFile) '"']);end% Choose the History file using a GUI
disp('SELECT HISTORY TEXT FILE');[HFile,HPath] = uigetfile('*','Select History File','History.txt');if isequal(HFile,0) disp('HISTORY: User selected Cancel');else disp(['HISTORY: User selected "', fullfile(HPath,HFile) '"']);endload([SPath SFile])Hist = dlmread([HPath HFile],'',27,0);X_Hist = Hist(:,1);Y_Hist = Hist(:,2);% check if the data is in velocity or frequency
% if data is in frequency (large), then convert using user input
if max(Y_Spec)>1e8 prompt = {'Enter Laser Wavelength (nm):'}; dlgtitle = 'Convert Frequency to Velocity'; dims = [1 30]; definput = {'1550'}; temp = inputdlg(prompt,dlgtitle,dims,definput); LaserWavelengthS = eval(temp{1}); clear temp % Convert to m/s
Y_Spec = Y_Spec.*(LaserWavelengthS/2)./1e9;else disp('Spectrogram velocity format was read as m/s');endif max(Y_Hist)>2500 prompt = {'Enter Laser Wavelength (nm):'}; dlgtitle = 'Convert Frequency to Velocity'; dims = [1 30]; definput = {'1550'}; temp = inputdlg(prompt,dlgtitle,dims,definput); LaserWavelengthH = eval(temp{1}); clear temp Y_Hist = Y_Hist.*(LaserWavelengthH/2)./1e9;else disp('History velocity format was read as m/s');end% Convert time axes to microseconds
if max(X_Spec)<1 X_Spec = X_Spec.*1e6;else disp('Spectrogram time format was read as mus');endif max(X_Hist)<1 X_Hist = X_Hist.*1e6;else disp('History time format was read as mus');end% PLOT IT ALL UP
figure;imagesc(X_Spec,Y_Spec,Z_Spec);colormap(jet);caxis([-60 0]);set(gca,'YDir','normal');hold onplot(X_Hist,smooth(Y_Hist),'color','k','LineStyle','-','LineWidth',0.5);xlabel('Time (\mus)')ylabel('Velocity (m/s)')C = colorbar;C.Label.String = 'Intensity (arb)';C.FontSize = 12;axis([min(X_Hist) max(X_Hist) min(Y_Hist) max(Y_Hist)])hold offset(gca,'FontSize',12)set(gcf,'PaperUnits','inches')set(gcf,'PaperPosition',[0 0 4 3])print([HPath HFile(1:(end-4)) '.png'],'-dpng','-r600');disp(['Spectrogram and History Image written as' HPath HFile(1:(end-4)) '.png']);% Make a grayscale compatible version (also for colorblind people)
figure;imagesc(X_Spec,Y_Spec,Z_Spec);colormap(flip(morgenstemning));caxis([-60 0]);set(gca,'YDir','normal');hold onplot(X_Hist,Y_Hist,'color','k','LineStyle','-','LineWidth',0.5);xlabel('Time (\mus)')ylabel('Velocity (m/s)')C = colorbar;C.Label.String = 'Intensity (arb)';C.FontSize = 12;axis([min(X_Hist) max(X_Hist) min(Y_Hist) max(Y_Hist)+1200])hold offset(gca,'FontSize',12)set(gcf,'PaperUnits','inches')set(gcf,'PaperPosition',[0 0 4 3])print([HPath HFile(1:(end-4)) '.png'],'-dpng','-r600');disp(['Grayscale Compatible Spectrogram and History Image written as' HPath HFile(1:(end-4)) 'Morgenstemning.png']);
Best Answer