https://fr.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2018-04-26T17:30:43Ztag:fr.mathworks.com,2005:Question/3975652018-04-26T15:03:03Z2018-04-26T17:30:43Zerror when running matlab<p>please help, i got this errors when i opened matlab and i cant write any function in commaned window, it gives undefined function 'buildin', besides i cant open my .m file it gives Undefined function or variable 'true'. and doesn't respond to "run" or any other action like X (exit)
i use matlab 2015b on windows 7.
please help me as possible fast as you can</p><p>Undefined function or variable 'matlabrc'.</p><p>Undefined function or variable 'which'.</p><p>Undefined function or variable 'rmiml.getAll'.</p><p>Undefined function or variable 'fschange'.</p><p>Undefined function or variable 'rmiml.visibleInToolstrip'.</p><p>Undefined function or variable 'rmiml.visibleInToolstrip'.</p><p>Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.mathworks.mlwidgets.graphics.ModelStateFactory.createNoSelectionModelState(ModelStateFactory.java:251)
at com.mathworks.mlwidgets.graphics.PlotToolSetFactory$3.parseComplete(PlotToolSetFactory.java:123)
at com.mathworks.mlwidgets.graphics.ModelStateFactory$ProductInfoListener$1$1.run(ModelStateFactory.java:1032)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
>>
thanks in advance</p>Hajer Najahhttps://fr.mathworks.com/matlabcentral/profile/authors/10702269-hajer-najahtag:fr.mathworks.com,2005:Question/3975932018-04-26T16:58:12Z2018-04-26T17:29:46ZPreview truncated at 128 characters: saving strings to a cell<p>I am working on compiling a set of data in a cell in MATLAB. One thing that I need are large strings. I have written code to create the strings I need, however, MATLAB truncates the preview of the cells at 128 characters (screenshot of output data below). Is there any way to stop MATLAB from doing this truncation so I can place my long strings inside a cell without any hassle?</p>Anthony Lamberthttps://fr.mathworks.com/matlabcentral/profile/authors/6848186-anthony-lamberttag:fr.mathworks.com,2005:Question/3975952018-04-26T17:11:57Z2018-04-26T17:29:28ZGenetic Algorithm and Direct Search Toolbox<p>If i want to optimize a problem using genetic algorithm ,what is the appropriate,</p><p>is it use :
the type of matlab code in this link <i><http://codem.group.shef.ac.uk/index.php/ga-toolbox ></i></p><p>or using the optimization tool ( <b>Genetic Algorithm and Direct Search Toolbox</b>) ,or this is related to the nature of the problem ,</p><p>any information is helpful for me,I have read lots of article but i am still confused about it.</p>Johan Johanhttps://fr.mathworks.com/matlabcentral/profile/authors/12590840-johan-johantag:fr.mathworks.com,2005:Question/3975812018-04-26T15:48:48Z2018-04-26T17:29:20ZPlease help me i get the error "Undefined function or variable 'varargin'. Error in Question4 (line 16) gui_mainfcn(gui_State, varargin{:});"<pre class="language-matlab">function varargout = Question4(varargout)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Question4_OpeningFcn, ...
'gui_OutputFcn', @Question4_OutputFcn, ...
'gui_LayoutFcn', [], ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
</pre><pre class="language-matlab">if nargout
[varargin{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
</pre><pre class="language-matlab">function open_Callback(hObject, evendata, handles)
</pre><pre class="language-matlab">a = imread('cristiano-ronaldo-goal-lebron-zlatan-01-960x640.jpg')
imshow(flip(a,1));
</pre><pre class="language-matlab">function Question4_OpeningFcn(hObject, evendata, handles, varargin)
</pre><pre class="language-matlab">handles.output = hObject;
</pre><pre class="language-matlab">guidata(hObject, handles);
</pre><pre class="language-matlab">function horizontal_Callback(hObject, evendata, handles)
</pre><pre class="language-matlab">a = imread('cristiano-ronaldo-goal-lebron-zlatan-01-960x640.jpg');
imshow(flip(a,1));
</pre><pre class="language-matlab">function vertical_Callback(hObject, evendata, handles)
</pre><pre class="language-matlab">a = imread('cristiano-ronaldo-goal-lebron-zlatan-01-960x640.jpg');
imshow(flip(a,2));
</pre>Phiri Tanakahttps://fr.mathworks.com/matlabcentral/profile/authors/12727214-phiri-tanakatag:fr.mathworks.com,2005:Question/3779182018-01-19T09:46:12Z2018-04-26T17:28:07ZMatlab Compiler - Runtime error in Qt Creator while initializing the MATLAB Runtime: shared object not open<p>I'm trying to include a Matlab program into Qt Creator on Ubuntu by using the Matlab Compiler.
Therefore, I use a simple test program. In terminal everything works fine when I export LD_LIBRARY_PATH like this:</p><pre> export LD_LIBRARY_PATH=/home/robin/Matlab_Runtime/v93/runtime/glnxa64:/home/robin/Matlab_Runtime/v93/bin/glnxa64:/home/robin/Matlab_Runtime/v93/sys/os/glnxa64:</pre><p>and then run the program.
Building the project in Qt Creator works fine, too, but on runtime I'm getting:</p><pre> An Error has occurred while trying to initialize the MATLAB Runtime.
The error is: Fatal error loading library /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmat.so Error: /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmat.so: shared object not open
An Error has occurred while trying to initialize the MATLAB Runtime.
The error is: Fatal error loading library /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmwmclbase.so Error: /home/robin/Matlab_Runtime/v93/bin/glnxa64/libmwmclbase.so: shared object not open
could not initialize the application properly</pre><p>My LD_LIBRARY_PATH is:</p><pre> /home/robin/Qt/5.9.1/gcc_64/lib:/home/robin/projects_opencv/Matlab_compiler_test/../../Matlab_Runtime/v93/runtime/glnxa64/:/home/robin/Matlab_Runtime/v93/runtime/glnxa64:/home/robin/Matlab_Runtime/v93/bin/glnxa64:/home/robin/Matlab_Runtime/v93/sys/os/glnxa64:/home/robin/Matlab_Runtime/v93/sys/opengl/lib/glnxa64:/home/robin/Matlab_Runtime/v93/extern/include</pre><p>Relevant lines in my .pro file:</p><pre class="language-matlab">INCLUDEPATH += /home/robin/Matlab_Runtime/v93/extern/include
LIBS += -L$$PWD/../../Matlab_Runtime/v93/runtime/glnxa64/ -lmwmclmcrrt
INCLUDEPATH += $$PWD/../../Matlab_Runtime/v93/runtime/glnxa64
DEPENDPATH += $$PWD/../../Matlab_Runtime/v93/runtime/glnxa64
LIBS += -L$$PWD/../../Matlab_Runtime/v93/bin/glnxa64/ -lmat -lmwmclbase
INCLUDEPATH += $$PWD/../../Matlab_Runtime/v93/bin/glnxa64
DEPENDPATH += $$PWD/../../Matlab_Runtime/v93/bin/glnxa64
</pre><p>I'm grateful for any kind of help on this. Thank you very much!</p>Robin Szymanskihttps://fr.mathworks.com/matlabcentral/profile/authors/11176022-robin-szymanskitag:fr.mathworks.com,2005:Question/3975502018-04-26T13:42:19Z2018-04-26T17:26:55ZIs there a way to calculate the mean of multiple data points at one time stamp of a time series?<p>I have a data set where for a number of time stamps, multiple data points are measured. Is there a way to calculate the mean of a time series at every timestamp? In the series, the first column are the timestamps and the second column are the measurements.</p>Pieter Spruijthttps://fr.mathworks.com/matlabcentral/profile/authors/3196236-pieter-spruijttag:fr.mathworks.com,2005:Question/3975802018-04-26T15:44:14Z2018-04-26T17:26:54ZHow do i create a single table from this for loop? I get lots of 1x3 tables from this code instead of a single table. I can't figure out how to index the values to arrays.<pre class="language-matlab">x_displacements = zeros(length(tracks), 1);
for k = 1:length(tracks)
current_track = tracks{k};
first_x = current_track(1, 2);
last_x = current_track(end, 2);
x_displacements(k) = last_x - first_x;
D = x_displacements(k);
T = table(first_x(:), last_x(:), D(:))
end
</pre>Troels Eliasenhttps://fr.mathworks.com/matlabcentral/profile/authors/12570796-troels-eliasentag:fr.mathworks.com,2005:Question/3975662018-04-26T15:04:10Z2018-04-26T17:26:07ZHow to measure runtime, if it is possible to close my laptop during the run?<p>so I don't want to count the pause time, when CPU is not working.</p>Mr M.https://fr.mathworks.com/matlabcentral/profile/authors/4980938-mr-mtag:fr.mathworks.com,2005:Question/3975762018-04-26T15:33:47Z2018-04-26T17:25:47ZReplace the symbol with value ?<p>Hello All
i have program with the following</p><p>syms O1 L1;
T1 = [cos(O1),0,sin(O1),0;sin(O1),0,-cos(O1),0;0,1,0,L1;0,0,0,1];</p><p>i need to run the program with the values
L1=1;
O1=0;</p><p>I have program to 5_DOF robotics arm and i need to check it with values so please help.
thanks</p>Mohammed kandeelhttps://fr.mathworks.com/matlabcentral/profile/authors/11600385-mohammed-kandeeltag:fr.mathworks.com,2005:Question/3975792018-04-26T15:41:05Z2018-04-26T17:25:36ZReplace the symbolic with values ?<p>Hello All
i have program with the following</p><p>syms O1 L1;
T1 = [cos(O1),0,sin(O1),0;sin(O1),0,-cos(O1),0;0,1,0,L1;0,0,0,1];</p><p>i need to run the program with the values
L1=1;
O1=0;</p><p>I have program to 5_DOF robotics arm and i need to check it with values so please help.
thanks</p>Mohammed kandeelhttps://fr.mathworks.com/matlabcentral/profile/authors/11600385-mohammed-kandeeltag:fr.mathworks.com,2005:Question/3729932017-12-14T18:08:13Z2018-04-26T17:25:13ZI dislike odd numbers<p>Can someone please upvote this question so that I have an even number of rep. points. I find even numbers much more pleasant to look at. Thanks!</p>Matt Jhttps://fr.mathworks.com/matlabcentral/profile/authors/1440443-matt-jtag:fr.mathworks.com,2005:Question/3975772018-04-26T15:37:13Z2018-04-26T17:24:52Zi am having a trouble in my code, it says index exceeds matrix dimensions. how would i solve it?<pre class="language-matlab">load y_cl_step_response;
t = ans(1,:);
y_step = ans(2,:);
clf;
plot(t,y_step);
y_max = max(y_step);
size_y_step =size(y_step);
y_ss_step = y_step(size_y_step);
os_per = (y_max-y_ss_step)/y_ss_step
damp_cl = sqrt((log(os_per)^2)/(pi^2+(log(os_per)^2)))
</pre>Mazin Al fulaitihttps://fr.mathworks.com/matlabcentral/profile/authors/6809013-mazin-al-fulaititag:fr.mathworks.com,2005:Question/3975992018-04-26T17:24:38Z2018-04-26T17:24:38ZHi I want to crop shape of the detected fish image. Please help me out .Thank you<p>https://photos.app.goo.gl/tgOY7seoRVPoVO1j2
This is the image that I have</p>Pavithra S Nhttps://fr.mathworks.com/matlabcentral/profile/authors/12251089-pavithra-s-ntag:fr.mathworks.com,2005:Question/3014682016-08-31T08:52:58Z2018-04-26T17:24:24ZWind rose with negative values<p>Hi,</p><p>I'm using the wind rose by Daniel Pereira with great pleasure (https://se.mathworks.com/matlabcentral/fileexchange/47248-wind-rose?requestedDomain=www.mathworks.com)</p><p>But I have would like to make a "flux rose" with concentration instead of wind speed - there will be negative values!!</p><p>An easy way would be to put in an off set but I would much rather just have the shift around 0 indicated by colors.</p><p>Hope you can help.</p><p>Cheers,
Jesper</p>Jesper Kamp Jensenhttps://fr.mathworks.com/matlabcentral/profile/authors/3819902-jesper-kamp-jensentag:fr.mathworks.com,2005:Question/3975982018-04-26T17:23:22Z2018-04-26T17:23:22ZCan anyone convert my matlab gui into .sh for ubuntu ?<p>I have a Matlab GUI (.m and .fig) and I am using the Matlab in windows 10. can anyone please make me a .sh file that is installable in Ubuntu for my GUI? It will be a great help as I don't have an access to Matlab in Ubuntu.</p>ahasan ratulhttps://fr.mathworks.com/matlabcentral/profile/authors/6532189-ahasan-ratultag:fr.mathworks.com,2005:Question/3206652017-01-17T00:32:13Z2018-04-26T17:21:54ZSending information from Simulink to Arduino over Serial<p>I am writing in this group to seek some help with sending PWM signal to Arudino over serial via Simulink</p><p>Problem description :</p><p>I am working on a personal project which involves building closed loop PID control loop, where I need to send PWM signals to fan, in order to control the position of a ball at a fixed height. The feedback signal is generated via a USB camera, which detects the position of the ball.</p><p>Since Arduino can't process the image, I am running my model in Simulink and sending the signal via serial to Arduino. But, the signal somehow doesn't reach or gets processed by the board.</p><p>Here is a step by step information on the process I followed to test debug</p><p>1. I upload a serial recieve model on the Arduino. It probes the serial port for the data. Once data is found, it is routed to the pin 9 as shown in the image</p><img src = "/matlabcentral/answers/uploaded_files/67662/serialRecieve.JPG"><p>2. In the simulink environment, to debug, I configured a serial send port (from instrument control toolbox) to transfer the desired PWM signal. However, this does not work. I tried debugging the pin 9, but no Voltage signal was received.</p><img src = "/matlabcentral/answers/uploaded_files/67663/SerialSend.JPG"><p>3. In the model above, I added a serial recieve block from the instrument control toolbox. This somehow slowed down the simulation. Each time step was being executed with some delay, but the PWM signals were getting transferred. The blower speed could be changed in accordance with the PWM signal. However this method is too slow for my control loop to work with</p><img src = "/matlabcentral/answers/uploaded_files/67664/SerialSend2.JPG"><p>Can someone please help me point out the possible error that I am making. I am very curious to find a workaround</p><pre> Masoom</pre>staticrain87https://fr.mathworks.com/matlabcentral/profile/authors/5132969-staticrain87tag:fr.mathworks.com,2005:Question/3975872018-04-26T16:29:31Z2018-04-26T17:21:43ZNegative background in image processing <p>Hi, I’m working with pulsed laser measurements and is calculating how much energy I have within an certain angle. My problem is that I get so different result when I am processing the “same” images taken at different times. The images have been calibrated with an energy that has been measured.</p><p>I’m taking an monocromatic image of an laser lobe. I also take a second image without the laser, I.e. the background image.</p><p>im = double(cdata)-double(background)</p><p>The room is dark and this background image should contain the electrical noise (black level is set to be right above zero in my image capture program) and the background light. I substract the two image but I still get a lot of negative values in the surrounding area around the laser lobe.</p><p>The pixels intensities is all summed up and is set to the measured energy. So I get a certain energy per pixel intensity. I then calculte the energy that I have within a certain angle. Problem is that this result vary to much from image to image at the same location taken at different times.</p><p>I don’t analyze the whole image. What I do is that I identify the location of the laser lobe and take out an box that is twice the size of the laser lobe, and analyz only this area. This is because it would take to much time to analyze the whole image.</p><p>Am I doing anything wrong here?</p><p>I have noticed that I get a lot of negative values in the area that is not the laser lobe? Will this affect the calibration?</p><p>I don’t understand how I can get negative so much negative values.. shouldn’t the background image and surround area around the laser lobe image take out each other?</p><p>I have filers in front of the camera at all times. The filters might have been different when I take same image at different times but it’s always the same as the background image. The black level might have been different for the lobe images measurements at different times.</p><p>Confused ...</p>captainmariahhttps://fr.mathworks.com/matlabcentral/profile/authors/8438943-captainmariahtag:fr.mathworks.com,2005:Question/3975632018-04-26T14:41:53Z2018-04-26T17:21:42ZHow to plot only negative values in a WindRose?<p>I'm working with a function called WindRose.m from Daniel Pereira.
https://de.mathworks.com/matlabcentral/fileexchange/47248-wind-rose
I'm trying to plot values of atmospheric temperature stability, which can be also negative.
I manage to plot all data together and also only the positive values, but I getting an error when I want to plot only the negatives values. And I don't understand what and where I must change the function to get the right plot.</p><p>First I tried to modify the signal directly from the function codes here:</p><p>speed = speed(speed<0);</p><p>When I run the whole code:</p><p>% directions</p><p>dir=WR;</p><p>% speeds</p><p>spd=sigma_theta; %specify with values on WindRose.m!</p><p>% Positions</p><p>Options = {'anglenorth',0,'angleeast',90,'labels',{'N','S','E','W'},'nFreq',5,'FreqLabelAngle',45,'nSpeeds',6,'Min_Radius',0,'TitleString',{'Temp.Stability - Wind rose';''},'LabLegend','Temperatur Stability','LegendVariable','{\sigma\theta}'};</p><p>% Windrose plot
[figure_handle,count, speeds, directions]= WindRose(dir,spd,Options);</p><p>appears:
Index exceeds matrix dimensions.</p><p>Error in WindRose>PivotTableCount (line 383)
counter = histc(speed(cond),[vwinds(:)' Inf]); %# ADDED 2015/Jun/22: Consider the wind speeds greater
than max(vwinds), by adding inf into the histogram count</p><p>Error in WindRose (line 304)
count = PivotTableCount(N,n,vwinds,speed,dir,NumberElements); % For each direction and for each speed, value of the
radius that the windorose must reach (Accumulated in speed).</p><p>On the second time, I restrict the number of the plot to only my negative values:</p><p>i=0;</p><p>for j = 1:52705
if sigma_theta(j)<=0
i=i+1;
sigma_theta_copia(i)=sigma_theta(j);
dir_copia(i)= dir(j);
indice(i)=i;</p><pre> end
end
spd=sigma_theta_copia;
dir2=dir_copia;
% Positions
Options2 = {'anglenorth',0,'angleeast',90,'labels',{'N','S','E','W'},'nFreq',5,'FreqLabelAngle',45,'nSpeeds',6,'Min_Radius',0,'TitleString',{'Temp.Instability - Wind rose';''},'LabLegend','Temperatur Instability','LegendVariable','{\sigma\theta}'};
% Windrose plot
[figure_handle,countn, speedsn, directionsn]= WindRose(dir2,spd,Options2);</pre><p>But, again I got Erros:</p><p>Error using xlim (line 31)
Limits must be a 2-element vector of increasing numeric values.</p><p>Error in WindRose (line 349)
xlim(axs,[-radiusmax radiusmax]/scalefactor); % Set limits</p><p>Unfortunately I cannot show the data that I using.</p>Teresa Rotavahttps://fr.mathworks.com/matlabcentral/profile/authors/11261738-teresa-rotavatag:fr.mathworks.com,2005:Question/3975972018-04-26T17:19:36Z2018-04-26T17:19:36ZArea between function and polyline<p>Hi everyone I have a problem. I try to calculate the area between a linear function (red) and a polyline (blue). I hope someone can help me.</p><img src = "/matlabcentral/answers/uploaded_files/114900/help.png">An Kuhttps://fr.mathworks.com/matlabcentral/profile/authors/11287703-an-kutag:fr.mathworks.com,2005:Question/3974462018-04-26T03:51:59Z2018-04-26T17:19:34ZHow to read two words from a text file?<p>As the question says, what is the easiest way to read just the first two words from a text file in MATLAB? There is more data in the text file, but I don't need to read them. Bonus points if I can store them in a string easily.</p>Deepansh Bhatiahttps://fr.mathworks.com/matlabcentral/profile/authors/10840170-deepansh-bhatiatag:fr.mathworks.com,2005:Question/3974542018-04-26T05:02:32Z2018-04-26T17:19:32ZImage with Horizontal Longitudinal View<p>Hi.
I'm new in image processing. I have a multi frame image which consist of 271 frames . and i want to cut each slice to get longitudinal view as shown in attached figure.
I have the upper portion of image . and want to get lower view . any one please help me</p><img src = "/matlabcentral/answers/uploaded_files/114820/1.PNG">Arsalan Akbarhttps://fr.mathworks.com/matlabcentral/profile/authors/12406612-arsalan-akbartag:fr.mathworks.com,2005:Question/3975232018-04-26T11:08:08Z2018-04-26T17:19:15ZQuadratic interpolation of an N dim array<p>Hello I would to know how I can perform a quadratic interpolation of an array using matlab ? it is worth mentioning that I am using interp1 for now.
thank you!</p>Anohttps://fr.mathworks.com/matlabcentral/profile/authors/6457136-anotag:fr.mathworks.com,2005:Question/3975902018-04-26T16:50:21Z2018-04-26T17:18:44ZNeed help with 3D-plot<p>Hi there,</p><p>I would like to ask how exactly can I plot 3D plot such as this</p><img src = "/matlabcentral/answers/uploaded_files/114887/3dplot.png"><p>from my 2D plot, which represents X-Y axes.</p><img src = "/matlabcentral/answers/uploaded_files/114888/2dplot.png"><p>I´m using this code</p><pre class="language-matlab">load m2.txt;
i=m2(:,2);
ia=i*1000;
fs=50000;
T=1/fs;
L=length(ia);
t=(0:L-1)*T;
nfft=2^nextpow2(L);
w=hann(L);
io=ia.*w;
I=fft(io,nfft)/L;
Ia=abs(I);
f=fs/2*linspace(0,1,nfft/2+1);
</pre><pre class="language-matlab">%Normal.
Iref=max(Ia);
Inorm=20*log10(Ia/Iref);
</pre><pre class="language-matlab">figure;
plot(f,(Inorm(1:nfft/2+1)));
set(gca, 'YLim',[-130,0]);
set(gca, 'XLim',[0,500]);
xlabel('f (Hz)','FontSize',9);
ylabel('Magnituda (dB)','FontSize',9);
hold on;
</pre><p>So I obviously need to add the Z-axis, which represents length of the signal (time). I need to find out for how long ceratin frequencies were present during the measurement.</p><p>Tried to use "surf" and "plot3" commands, but all my attempts failed, so I would be really, really thankful for any insight.</p><p>Regards,</p><p>Patrik</p>Patrik Soukuphttps://fr.mathworks.com/matlabcentral/profile/authors/12443421-patrik-soukuptag:fr.mathworks.com,2005:Question/3973752018-04-25T19:04:12Z2018-04-26T17:18:01ZHow to extract repeatedly information from a text and store a specific table?<p>Hello,
I have SDF file containing structure information over 150K substances and I'm interested in extract some information from there. I had to convert to .xls due to matlab supporting.</p><p>You can visualize an example of this file below. The ORIGINAL TEXT FILE IS AVAILABLE AS ONTHOLOGY.XLS</p><p>Each structure starts with a code (in this example: Q2785366) and finishes with a $$$$.</p><p>Q2785366-1 %name of structure</p><p>% A set of numbers that represent a .mol file. I'm not interested on them.</p><p>%Attributes</p><p>"> <a href = "InChIKey">InChIKey</a>"
InChIKey=FPRJHXLFTAYEJH-UHFFFAOYSA-N</p><p>"> <a href = "SMILES">SMILES</a>"
COC1=C2C(OC)=C3C=COC3=NC2=C(OCC(O)C(C)(C)O)C=C1</p><p>> <a href = "Kingdom">Kingdom</a>
Organic compounds</p><p>"> <a href = "Superclass">Superclass</a>"
Organoheterocyclic compounds</p><p>"> <a href = "Class">Class</a>"
Quinolines and derivatives</p><p>"> <a href = "Subclass">Subclass</a>"
Furanoquinolines</p><p>"> <a href = "Intermediate">Nodes</a>"</p><p>"> <a href = "Direct">Parent</a>"
Furanoquinolines</p><p>"> <a href = "Alternative">Parents</a>"
Furopyridines</p><p>"> <a href = "Molecular">Framework</a>"
Aromatic heteropolycyclic compounds</p><p>"> <a href = "Substituents">Substituents</a>"
Furanoquinoline</p><p>"> <a href = "Structure-based">description</a>"
This compound belongs to the class of organic compounds known as furanoquinolines. These are compounds containing a furan ring fused to a quinoline.</p><p>"> <a href = "Ancestors">Ancestors</a>"
1,2-diols</p><p>> <a href = "External">Descriptors</a></p><p>$$$$</p><p>I'm interested in organize this data in a new table. The rows related the substances and columns with features. Below are described the features which I´m interested.</p><p>Column 1: InChIKey (using only information after "=")</p><p>Column 2: SMILES (Only Code)</p><p>Column 3: Kingdom (Only text)</p><p>Column 4: Superclass (Only text)</p><p>Column 5: Class (Only text)</p><p>Column 6: Subclass (Only text)</p><p>Column 7: Framework (Only text)</p><p>Thank you.</p>Alan Cesar Pilon Mirohttps://fr.mathworks.com/matlabcentral/profile/authors/12513699-alan-cesar-pilon-mirotag:fr.mathworks.com,2005:Question/3974582018-04-26T05:50:42Z2018-04-26T17:16:29ZBest way to Start using App Designer?<p>Jumping in with both feet, I have tried to create an app to run some simple code that manipulates vectors in the complex plane.
I have reviewed the existing help and tutorials on the subject but it isn't entirely clear how to start the process. My intuition led me to think that you'd launch App Designer from the code you were working on, and then create the GUI to interface with the code. From what I have seen so far, it is the other way around....you create the GUI first on a blank slate, THEN you have to insert the "functional" code that you want the GUI to control.
Any comments on my observations? Feel free to give advice!</p>M Ghttps://fr.mathworks.com/matlabcentral/profile/authors/10468698-m-gtag:fr.mathworks.com,2005:Question/3975912018-04-26T16:55:11Z2018-04-26T17:15:00Zexcel cells wider in matlab export<p>I have exported the outputs of the program I´ve done to excel but the cells are in the basic width, can matlab make the cell width automatically wider depending on the width of the values and words in the cell???</p>loma elmossallamyhttps://fr.mathworks.com/matlabcentral/profile/authors/12175210-loma-elmossallamytag:fr.mathworks.com,2005:Question/3975962018-04-26T17:14:52Z2018-04-26T17:14:52ZHow can I do a piecewise least-squares regression for unknown data (of similar types)?<p>I would like to do a piecewise least-squares regression from data points. The program must ask for the user input for the file, so the data points will change. I cannot use built-in functions for the least-squares regression, and it will involve both linear and nonlinear regression. I have attached an example of the graph of the data points.</p>Rebecca Irlmeierhttps://fr.mathworks.com/matlabcentral/profile/authors/7536323-rebecca-irlmeiertag:fr.mathworks.com,2005:Question/3908932018-03-27T06:41:11Z2018-04-26T17:10:09ZWhat is RhoResolution and ThetaResolution in Hough Transform?<p>can someone explain to me what is RhoResolution and ThetaResolution in Hough?
what the different between :</p><p>X = hough(A), and
X = hough(A,'RhoResolution',0.5,'ThetaResolution',0.5);</p><p>Thanks</p>Kuncoro tmhttps://fr.mathworks.com/matlabcentral/profile/authors/10188702-kuncoro-tmtag:fr.mathworks.com,2005:Question/3975842018-04-26T16:06:01Z2018-04-26T17:09:47ZHi I need help solving this program. I don't know where to begin and it is worth a major percentage of my grade!<p>I need to simulate a game from this website. <a href = "http://www.darting.com/Darts-Rules/">http://www.darting.com/Darts-Rules/</a>.</p><p>Program Structure:</p><p>You will be provided with two 512x512 matrices that represent a dart board. The first includes the value for each wedge around the board, the value in the matrix is the wedge value (or zero if you are off the board). For instance, if you select a number in the upper middle of the board (i.e. location 100,256) the resulting value will be 20. The second matrix indicates where the rings are for single, double or triple. In this case, each location has a value of 1 for single rings, 2 for double ring, 3 for triple ring, and zero if you are off the board.</p><p>You should use a random number generator to select one place on the dartboard, by row and column, which represents a dart throw. This location will be the same for both data matrices. Your code must display (i.e. triple – 14) where each dart hits (this can be done with text, it does not require a visual representation) for each round. Then display the current score for all players.</p><p>This process should continue until the game is successfully completed. Since you are using random number generators and not incorporating any skill into the throws the game simulation will likely take many rounds. When developing your code it might work better to start with small goals before trying to let the simulation run for an entire game.</p>mn nhttps://fr.mathworks.com/matlabcentral/profile/authors/12705815-mn-ntag:fr.mathworks.com,2005:Question/3975942018-04-26T17:09:39Z2018-04-26T17:09:39ZHow can I simulate with data that is taken from comport?<p>I have a dynamic model and ı wil read the two integer data from comport and then ı should send these data to my simulink model. Also at the same time the simulation should be done.</p>bayram özmenhttps://fr.mathworks.com/matlabcentral/profile/authors/7871904-bayram-ozmentag:fr.mathworks.com,2005:Question/3498502017-07-22T15:48:30Z2018-04-26T17:06:58ZHow to create a click-train with <p>I need to create a click-train of 1s presented as 1 then two 1s then three 1s. The SOA is 75 ms. Each 1 is 100 microseconds and the interclick interval when there are two or three 1s is 4 ms. The SOA stays the same at 75 ms no matter if there is one,two, or three ones. It seems it should be quite easy.</p>Patricia Van Roonhttps://fr.mathworks.com/matlabcentral/profile/authors/2937925-patricia-van-roontag:fr.mathworks.com,2005:Question/3910332018-03-27T16:01:31Z2018-04-26T17:06:40ZHow to save solid-color figure to tif file?<p>I am trying to save a tif image with a uniform color to see how that color appears in various applications (PhotoShop etc). Below I create a figure, set its background to green, and save it as a tif file. But when I open the tif file in PhotoShop or Windows Photos it's white, so I've lost the green background of the figure. And the second example also fails when I make a large green axis; the tif file appears white. I believe I am incorrectly stating the command line save command to create the tif file. How do I save an image file showing a solid region of color with no white border, i.e. filled to the image edge?</p><pre> f1 = figure;
set(f1, 'color', 'g') % Make the figure background green
saveas(gcf, 'green background1.tif') % When this tif file is opened, it appears white not green</pre><p>Below changing the axis color also results in a white tif file when opened,</p><pre> f2 = figure;
hAx1 = subplot(1,1,1); % Make one big axis
set(hAx1,'Unit','normalized','Position',[0 0 1 1], ... % set the axes to full screen
'xgrid', 'off', 'ygrid', 'off', 'xtick', [], 'ytick', []); % Keep the color uniform (no grid lines)
set(hAx1, 'color', 'g'); % Make the axis green
saveas(gcf, 'green background2.tif') % When this tif file is opened, it also appears white not green</pre><p>But when I choose File > Save As from the f2 figure window, and choose to save to a tif file, the resulting tif file does appear green! How can I do this from the command line?</p>KAEhttps://fr.mathworks.com/matlabcentral/profile/authors/9495793-kaetag:fr.mathworks.com,2005:Question/406292012-06-08T10:12:30Z2018-04-26T17:05:02Zbar plot, value on top<p>Hi
This actually works to some extent but the problem is i got all the values for each bar shown on top.
So for each bar all the Y values are being shown.</p><pre class="language-matlab">x=[1:2:23]';
y=abs([121 41 20.6 12.5 8.1 5.8 4.4 3.5 3 2.7 2.3 2.1]);
bar(x,y)
text(x,y,num2str(y,'%0.2f'),...
'HorizontalAlignment','center',...
'VerticalAlignment','bottom')
</pre><p>Please tell me what is wrong!
Thanks!</p>gabehttps://fr.mathworks.com/matlabcentral/profile/authors/3524544-gabetag:fr.mathworks.com,2005:Question/3974412018-04-26T03:26:23Z2018-04-26T17:00:24ZHow to solve the problem?<p>I have a 198x198 matrix, an image. I need to get 3x3 matrices each from the above matrix. Total, 22 matrices, how to access each of them? can somebody help me with the code??</p>Darsana P Mhttps://fr.mathworks.com/matlabcentral/profile/authors/9051001-darsana-p-mtag:fr.mathworks.com,2005:Question/3971442018-04-24T19:55:32Z2018-04-26T16:57:04ZHow to define G=graph(s,t,weights,NodeTable)<p>My method is to create a social network based on a dataset in Matlab. Each node represents a stakeholder, the edge shows communication among two stakeholders and its weight indicates the total instance of communication between them.
I think the following method is appropriate to my subject:
G=graph(s,t, weights, NodeTable);
How can I define the above variables with this regards that my dataset includes letters?
I will be grateful to have any similar examples or related link in this field.</p>phdcomputer Enghttps://fr.mathworks.com/matlabcentral/profile/authors/12712473-phdcomputer-engtag:fr.mathworks.com,2005:Question/3975622018-04-26T14:41:20Z2018-04-26T16:53:54ZHow do i get the output for each iteration of code?<p>I have a program in which i run two matrices through the same code and they give me an output for each iteration(the iteration is associated with which matrix i run through it). The thing is, in this code i run through seven iterations again(this iteration has the purpose of closing in the result i want), how do i get the last output for each matrix iteration? I mean i could remove the semicolon and check manually, but is there an easier way to do it? simply put the code looks like this</p><pre> for iter=1:2
x=y{iter};
c=[0;0;0;0];
...
for k=1:7
...
c=a+b;
end
end</pre><p>in which x are the different matrices i use in the code, y is the variable i use to call upon the different matrices and this c is what i'm looking for. Or even save those c's on a variable and/or a file, that would be perfect</p><p>edit. I got how to show them by using this</p><pre class="language-matlab">if k==7
disp(c)
end
</pre><p>but i don't know how to attach it to a variable, or cell array etc</p>Feliciano Döringhttps://fr.mathworks.com/matlabcentral/profile/authors/10365947-feliciano-doringtag:fr.mathworks.com,2005:Question/3975892018-04-26T16:35:35Z2018-04-26T16:53:29ZHow to use syntax T = readtable(filename) for creating a table from a file?<p>I put the excel dataset file (.xlsx) with specific 'filename' in the Matlab projects saving path and then
I used this syntax in command window</p><p>T = readtable(filename)</p><p>the program gives this error:</p><p>Undefined function or variable 'filename'</p><p>I'll be very grateful if suggest me a soloution</p>phdcomputer Enghttps://fr.mathworks.com/matlabcentral/profile/authors/12712473-phdcomputer-engtag:fr.mathworks.com,2005:Question/3974682018-04-26T06:34:46Z2018-04-26T16:52:33ZElements in xlsread output MATLAB version R2018a<p>I am trying to understand the function that Matlab executes for importing data from excel file.</p><p>The very first function in the script generated from import command is the following:</p><pre class="language-matlab">%% Import the data
</pre><pre> [~, ~, raw] = xlsread('C:\Users\gtsutskiridze\Documents\MATLAB\G10XRATE.XLS','g10xrate','A2:J6238')
raw(cellfun(@(x) ~isempty(x) && isnumeric(x) && isnan(x),raw)) = {''}</pre><p>I have read the help file for xlsread and it says the following:</p><pre class="language-matlab">[NUM,TXT,RAW]=xlsread(FILE) reads data from the first worksheet in the
MicrosoftExcel spreadsheet file named FILE and returns the numeric data in array NUM.
Optionally, returns the text fields in cell array TXT, and the unprocessed data (numbers and text) in cell array RAW.
</pre><p>My question is the following: What do does <b>~</b> mean in the output of the xlsread [~, ~, raw] ?</p>GIorgi Tsutskiridzehttps://fr.mathworks.com/matlabcentral/profile/authors/8517681-giorgi-tsutskiridzetag:fr.mathworks.com,2005:Question/423582012-06-29T06:56:42Z2018-04-26T16:51:58Zspeech to text and text to speech conversion (STS)<p>Hi</p><p>I am working on conversion of Speech to TExt and then Text to Speech.. I want guidance in it on how to proceed through it in matlab ..</p>Maxhttps://fr.mathworks.com/matlabcentral/profile/authors/3008944-maxtag:fr.mathworks.com,2005:Question/3971502018-04-24T20:31:31Z2018-04-26T16:50:52ZFind the time delay between two signals with different frequencies<p>Hello everybody,</p><p>I have two signals (see figure 3). The first comes from the shaker (blue color/sampling frequency=5000) and the second is a measurement of a plate above the shaker (red color/sampling freq=320). I have tried to correct the delay time, but it is not consistent (apparently there should be a better phase adjustment, see fig. 2). I used xcorr function. I am new to matlab. What could be wrong?</p><p>Thanks in advance</p><img src = "/matlabcentral/answers/uploaded_files/114598/fig2and3.PNG">Samuel Felipe Mollepaza Tarazonahttps://fr.mathworks.com/matlabcentral/profile/authors/8184219-samuel-felipe-mollepaza-tarazonatag:fr.mathworks.com,2005:Question/3975452018-04-26T13:30:10Z2018-04-26T16:49:22ZHow can i get the activation key i have the license number 42<p>How can i get the activation key i have the license number 42</p>hendrick t chikwanhahttps://fr.mathworks.com/matlabcentral/profile/authors/12369843-hendrick-t-chikwanhatag:fr.mathworks.com,2005:Question/3975852018-04-26T16:10:05Z2018-04-26T16:49:17ZHelp with making square and symmetric subplots<p>Dear all,</p><p>I am trying to plot 6 graphs in a single plot using subplot function. I would like them to look in a square shape with same axes lengths. However, this is what I get (see attached figure). I have not made any arrangements in my code on subplots.</p><p>The code:</p><pre> figure(3)</pre><pre> subplot(6,2,1,'align');
title(['Episode: ',int2str(i),' epsilon: ',num2str(epsilon)]);
plot(xpoints,ypoints,'Color',[0,0.7,0.9]);
pbaspect([2 2 1]);
xlabel('r');
ylabel('x');
drawnow</pre><pre> subplot(6,2,2,'align');
plot(xpoints,zpoints, 'Color','r');
pbaspect([1 1 1]);
xlabel('r');
ylabel('y');
drawnow</pre><pre class="language-matlab">subplot(6,2,3,'align');
plot(xpoints,lpoints, 'Color','r');
pbaspect([1 1 1]);
xlabel('r');
ylabel('z');
drawnow
</pre><pre class="language-matlab">subplot(6,2,4,'align');
plot(xpoints,convpoints, 'Color','r');
pbaspect([1 1 1]);
xlabel('r');
ylabel('m');
drawnow
</pre><pre class="language-matlab">subplot(6,2,5,'align');
plot(xpoints,explore, 'Color','b');
pbaspect([1 1 1]);
xlabel(r');
ylabel('n');
drawnow
</pre><pre class="language-matlab">subplot(6,2,6,'align');
plot(xpoints,gpoints, 'Color','r');
pbaspect([1 1 1]);
xlabel('r');
ylabel('k');
drawnow
</pre><p>Really appreciate it if someone can help with this.</p><p>Kind Regards,</p><p>Kyana</p>Kyana Shayanhttps://fr.mathworks.com/matlabcentral/profile/authors/8825507-kyana-shayantag:fr.mathworks.com,2005:Question/3974392018-04-26T03:00:30Z2018-04-26T16:48:46ZSave a .fig from a subplot as subplots are building up?<p>Hello,</p><p>I am building up subplots in a loop like:</p><pre> h2(nn-1)=subplot(6,4,nn-1);
mytitle=name;
plot(x,y0,'k.',x,y,'r-',x,yp,'b-');</pre><p>where nn is looping. Before I go to the next nn, I'd like to save off a full size version of the subplot to a .fig. Everytime I try something, the saved off works, but somehow the subplot doesn't build up anymore (there is only the last lower corner plot existing on the subplot). Somehow the save-off interfers with the main subplots.</p><p>What's the right way to build subplots while also saving off copies?</p><p>Thanks.</p>David Pesetskyhttps://fr.mathworks.com/matlabcentral/profile/authors/6182327-david-pesetskytag:fr.mathworks.com,2005:Question/3973802018-04-25T19:13:46Z2018-04-26T16:47:12ZIncrement the value inside another loop<pre class="language-matlab">for i=1:10
if(true)
while(true)
i=i+1;
end
end
end
</pre><p>will this increment or update the value of i ?</p>Mushahid Shamimhttps://fr.mathworks.com/matlabcentral/profile/authors/10365636-mushahid-shamimtag:fr.mathworks.com,2005:Question/3973362018-04-25T15:28:09Z2018-04-26T16:44:00ZDisplay different Color in a popup menu using GUIDE<p>Hi there,</p><p>I’m trying to create a popup menu for Color Selection. I managed to display the different Colors in the popup menu (see first picture) ...</p><img src = "/matlabcentral/answers/uploaded_files/114729/002.png"><p>but since one is selected it doesn’t display the Color anymore. Instead it shows the HTML Code that I am using to display the Color (second picture)</p><img src = "/matlabcentral/answers/uploaded_files/114730/001.PNG"><p>Can someone please help displaying the selected Color? Tanks a lot!</p><p>My Code is the following:</p><pre class="language-matlab">%HTML text to display Colors
</pre><pre class="language-matlab">colergen = @(color,text) ['<html><table border=0 width=50 bgcolor=',color,'><TR><TD>',text,'</TD></TR> </table></html>'];
</pre><pre class="language-matlab">set(handles.uitable1, 'columnname', {'Region', 'visible', 'Color'});
</pre><pre class="language-matlab">set(handles.uitable1, 'columneditable', [true,true,true])
</pre><pre class="language-matlab">col_fmt = get(handles.uitable1, 'ColumnFormat');
</pre><pre class="language-matlab">col_fmt{3} = {colergen('#353477', ' '), colergen('#EBF4FC', ' '), colergen('#FFF7E7', ' ')}
</pre><pre class="language-matlab">set(handles.uitable1, 'ColumnFormat', col_fmt);
</pre><pre class="language-matlab">set(handles.uitable1, 'columneditable', [true,true,true])
</pre><pre class="language-matlab">Names = {'Region 01', true, ''; 'Region 02', true, ''};
</pre><pre class="language-matlab">set(handles.uitable1, 'data', Names);
</pre>Lisann Liebhttps://fr.mathworks.com/matlabcentral/profile/authors/11889592-lisann-liebtag:fr.mathworks.com,2005:Question/3921652018-04-02T17:01:53Z2018-04-26T16:41:37ZHow to separate domains by the matrix describing the classes<p>Dear friend. Please, suggest me how to perform the following visualization by Matlab and, maybe, Image Processing Toolbox.
Let we have a matrix with entries taken from a number of categories. The visual presentation of the matrix as follows (3 categories):</p><img src = "/matlabcentral/answers/uploaded_files/111250/snap119.jpg"><p>How to separate domains corresponding to categories? In other words, how to draw the red separating curves as on figure?</p>Konstantinhttps://fr.mathworks.com/matlabcentral/profile/authors/3853292-konstantintag:fr.mathworks.com,2005:Question/3974912018-04-26T08:36:01Z2018-04-26T16:41:09ZWait a boolean variable becomes false<p>I have connected the software Plant Simulation to Matlab and thus when I start the matlab program the simulation on Plant SImulation correctly works. However, after this simulation I have to analyse the data but matlab proceeds even if the simulation is not finished. I am thinking about using the COM-function IsSimulationRunning, which returns true if running and false if not, to say matlab to wait until this variable becomes false.</p><p>However I do not know how to do that. This because there should be a dynamic control of this variable to see if it is true or not.</p><p>How can I do that? Thanks</p>NFhttps://fr.mathworks.com/matlabcentral/profile/authors/11765668-nftag:fr.mathworks.com,2005:Question/697122013-04-03T16:08:11Z2018-04-26T16:40:08ZCreate an 'other' category for classregtree?<p>I'm using classregtree to create a decision tree for analyzing low resolution images and determining their taxanomic classification. I have created three categories of interest. When predicting data, if the data is not one of the three categories, I would like it to go in an 'other' category and/or not be fit into one of my existing categories. Is there a way to do this other than creating another category that consists of random and greatly varying taxa?</p>Jessicahttps://fr.mathworks.com/matlabcentral/profile/authors/3609778-jessicatag:fr.mathworks.com,2005:Question/3975882018-04-26T16:34:55Z2018-04-26T16:34:55ZHow is it possible to use a validation set with a LSTM?<p>When I try to use the Validation set with a LSTM layer, it shows the following error:</p><pre class="language-matlab">options = trainingOptions('adam', ...
'ExecutionEnvironment','gpu', ...
'GradientThreshold',1, ...
'MaxEpochs',maxEpochs, ...
'ValidationData',{XTest,YTest},...
'MiniBatchSize',miniBatchSize, ...
'LearnRateSchedule','piecewise', ...
'SequenceLength','longest', ...
'Shuffle','never', ...
'Verbose',0, ...
'Plots','training-progress');
net = trainNetwork(XTrain,categorical(YTrain),layers,options);
</pre><p>Error:</p><pre class="language-matlab">Training with validation data is not supported for networks with LSTM layers.
</pre><p>Is there another way to use the Validation set during the training of the network?</p>Sofíahttps://fr.mathworks.com/matlabcentral/profile/authors/2648856-sofiatag:fr.mathworks.com,2005:Question/3974972018-04-26T08:59:25Z2018-04-26T16:33:53ZHow to define cell arrays that their elements are extracted from a Dataset?<p>I have two 29*1 cells in my Matlab workspace (they were two columns in my excel dataset with the names: Assignee & Reporter that I imported them to Matlab workspace as two cells). my aim is to scroll these two cells by two counters (i & j ) and compare them in the way that if two reporters cell elements are similar while their assignee cell elements are not the same so these two Assignee elements will be two nodes in my graph and communicate by an edge. but there is a problem in defining the cells Assignee and Reporter. I wrote these lines:</p><pre class="language-matlab">load firefox.mat
s={};
t={};
G=graph(s,t);
%Assignee=table(Assignee); ???
Assignee=cell(); ???
Reporter=cell(); ???
for i=2:29 %my Dataset has 29 rows
for j=2:29
if Assignee(i)~=Assignee(j)
if Reporter(i)==Reporter(j)
s={Assignee(i)};
t={Assignee(j)};
g=graph(s,t);
break;
end
break;
end
end
end
Plot(G);
</pre><p>I'll be very grateful if suggest me what is the correct method for this problem?or how the lines must modify to create the graph correctly?</p>phdcomputer Enghttps://fr.mathworks.com/matlabcentral/profile/authors/12712473-phdcomputer-eng