https://www.mathworks.com/matlabcentral/answers/questions MATLAB Answers — New Questions 2021-01-21T09:29:45Z tag:www.mathworks.com,2005:Question/722818 2021-01-21T08:37:25Z 2021-01-21T09:28:42Z For loop: access values in between steps Hi I have a for-loop where first only certain rows of a matrix are dealt with: for i = 1:3:100 %3 is an example step size, the step size is a variable in the program %do something with rows 1, 4, 7, 10, 13, 16 ... end After this, the remaining rows, i.e. rows 2,3, 5,6, 8,9, ... need to be filled up using the data in the rows calculated above. I don't see which would then be the most optimal method to define this new for loop. Possibly, for loops aren't even the best way to approach this? Thanks for your input! Simon Allosserie https://www.mathworks.com/matlabcentral/profile/authors/19903548 tag:www.mathworks.com,2005:Question/722723 2021-01-21T04:36:29Z 2021-01-21T09:28:16Z Hi all! Could you please help me understand this piece of code here? %% setup hold all a = arduino('COM3', 'Uno'); mpu = i2cdev(a,'0x68'); %mpu adress is normally 0x68 writeRegister(mpu, hex2dec('B6'), hex2dec('00'), 'int16'); %reset data = zeros(10000,14,'int8'); %prelocating for the speed j = 1; a1 = animatedline('Color',[1 0 0]); a2 = animatedline('Color',[0 1 0]); a3 = animatedline('Color',[0 0 1]); legend('Accel_x','Accel_y','Accel_z') %% loop while(true) x=1; for i=59:72 % 14 Data Registers for Accel,Temp,Gyro data(j,x) = readRegister(mpu, i, 'int8'); x = x + 1; end y = swapbytes(typecast(data(j,:), 'int16')) %if your system is big-endian remove the swapbytes function addpoints(a1,j,double(y(1))); addpoints(a2,j,double(y(2))); addpoints(a3,j,double(y(3))); j = j+1; drawnow limitrate end WAN NOR NAZIRA MUSTAPA KAMAL https://www.mathworks.com/matlabcentral/profile/authors/20727395 tag:www.mathworks.com,2005:Question/720894 2021-01-19T09:30:26Z 2021-01-21T09:28:13Z How can I remove the additive periodical noise from the image? I got an image (Project1.png) that had been corrupted by periodical noise A= 20 * sin(0.1*pi*x+0.1*pi*y). Try to remove the noise by apply the DFT on the image and multiple with the design filter (FilterImage.jpg) that I been created then inverse back to get the filtered image. But its seem like the final image not remove the noise at all. Any idea how to remove it or suggestion on how to do it? The design filter I created was basically based on the DFT of the noise (F=fft2((A)); Fs=(fftshift(F));) Thanks clear all; close all; clc; [filename, pathname]=uigetfile('*.*','Select Grey Scale Image'); filewithpath=strcat(pathname,filename); img=imread(filewithpath); [row,col]=size(img) F=fft2(double(img)); %DFT of Image Fs=fftshift(F); %Shifting Spectrum to Centre % Getting H(u,v) - Filter H=imread('FilterImage.jpg'); H=double(H/255); Fsf=Fs.*H; %Inverse DFT fimg=ifft2(fftshift(Fsf)); imgr=uint8(real(fimg)); subplot(221); imshow(img); subplot(222); imshow(log(1+abs(Fs)),[]); subplot(223); imshow(imgr, []); subplot(224); imshow(log(1+abs(Fsf)),[]); AP https://www.mathworks.com/matlabcentral/profile/authors/20290068 tag:www.mathworks.com,2005:Question/102220 2011-12-16T16:59:00Z 2021-01-21T09:17:48Z How do I place errorbars on my grouped bar graph using function ERRORBAR in MATLAB? I use the following to create a grouped bar graph: model_series = [10 40 50 60; 20 50 60 70; 30 60 80 90]; model_error = [1 4 8 6; 2 5 9 12; 3 6 10 13]; bar(model_series, &#39;grouped&#39;); hold on errorbar( model_series,model_error) The result is a grouped bar graph with error bars placed in between each group of bars: <<http://www.mathworks.com/matlabcentral/answers/uploaded_files/303809/1321b2d0ee66436aab32f2490f6e6f8d.png>> I would like to have &quot;errorbar&quot; place error bars on the center of each bar. MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/722813 2021-01-21T07:56:47Z 2021-01-21T09:14:51Z How to combine Space and dot expressions in Matlab? I'm trying to include blank spaces and a dot above the greek letter psi in one label. The command for allowing spacing is (with missing dot above psi): plot(1:10) ylab = sprintf('$\\psi%s [deg/s]$', repmat('\ ',1,1)); ylabel(ylab,'interpreter','latex'); The command for doing dots above a letter in tex is: plot(1:10) ylabel('$\dot{\phi}$', 'Interpreter','latex') How do i combine those two? Extra question: Is it possible to exclude the "[deg/s]" from the latex interpreter, so that it has the normal font of matlab plots and only the greek letter is in latex? Kind regards, Sebastian Sebastian Konsek https://www.mathworks.com/matlabcentral/profile/authors/17822369 tag:www.mathworks.com,2005:Question/722803 2021-01-21T07:47:29Z 2021-01-21T09:12:25Z Undefined function 'split' for input arguments of type 'char' Hello everyone, When I'm using EP_ toolkit, the above problem description appears。i used matlab2013a.Does anyone know how can i solve this problem Siqi Liu https://www.mathworks.com/matlabcentral/profile/authors/21041905 tag:www.mathworks.com,2005:Question/722858 2021-01-21T09:12:08Z 2021-01-21T09:12:08Z Requirements: 1. Show the Bode plots for the plant, controller, and the total open-loop transfer functions 2. Show the step response plots from part (e) 3. Show all calculations 4. Be sure to include discussions regarding the comparison of the va a) find the system phase margin with D(z)=1 (b) design a phase-lag controller with a dc gain of 10 that yields a system phase margin according to the first letter of your last name: A-H 40 degrees J-M 45 degrees P-Z 50 degrees (c) design a phase-lead controller with a dc gain of 10 that yields a system phase margin according to the first letter of your last name: A-H 40 degrees J-M 45 degrees P-Z 50 degrees (d) Design a PI controller that yields a system phase margin according to the first letter of your last name: A-H 40 degrees J-M 45 degrees P-Z 50 degrees moh mamoorri https://www.mathworks.com/matlabcentral/profile/authors/20808189 tag:www.mathworks.com,2005:Question/722853 2021-01-21T09:11:27Z 2021-01-21T09:29:45Z Problem in displaying or printing final result. Hi everybody, I need help in my codding, the code and my final results are as below: [rYY_es_Max, rYY_es_Lags] = max(rYY_es); [rYY_Max , rYY_Lags] = max(rYY); [rYY_ideal_Max , rYY_ideal_Lags] = max(rYY_ideal); Maximum_rYY_es = ['Estimated rYY_Max = ', num2str(rYY_es_Max), ' The Point of Maximization = ', num2str(m(rYY_es_Lags))]; Maximum_rYY = ['rYY_Max = ', num2str(rYY_Max), ' The Point of Maximization = ', num2str(m(rYY_Lags))]; Maximum_rYY_ideal = ['rYY_ideal_Max = ', num2str(double(rYY_ideal_Max)), ' The Point of Maximization = ', num2str(m(rYY_ideal_Lags))]; disp(Maximum_rYY_es) disp(Maximum_rYY) disp(Maximum_rYY_ideal Estimated rYY_Max = 2.9497 The Point of Maximization = 0 rYY_Max = 2.9898 The Point of Maximization = 0 rYY_ideal_Max = 3 The Point of Maximization = 0 I just want to enhance the visual output; so I want to make all 'The point of Maximization = 0' sentences in line. the problem is the numbers can varry for example for the first one it can display 2.95 so I can not use Blank to fix this problem, I was just wondering if is it possible to make a Matrix of strings and numbers to make eveything in place and line or not? or is there any other soloution to this problem? Masoud Dorvash https://www.mathworks.com/matlabcentral/profile/authors/20754293 tag:www.mathworks.com,2005:Question/722843 2021-01-21T09:09:16Z 2021-01-21T09:09:16Z Low pass filter VS high pass filter I have this filter and I want to analyze it. How can I know from the plot that its a highpass filter or a lowpass filter? Omar Abulayla https://www.mathworks.com/matlabcentral/profile/authors/18565470 tag:www.mathworks.com,2005:Question/722838 2021-01-21T09:08:39Z 2021-01-21T09:08:39Z While Loop for control system Hi, i go a problem with a function that i cant find any wrongs. :( sadly because i'm not a programer... so : function OutLoop =fcn(InSignal,ControlSignal,MaxPoint,StepIteration,MinPoint) OutLoop=ControlSignal; while InSignal>MaxPoint; OutLoop=OutLoop+StepIteration; end while InSignal<MinPoint; OutLoop=OutLoop-StepIteration; end Thats my function and the point is: I want to control a value (InSignal) and change (OutLoop) that will change other value witch will change the InSignal. I will explane what i mean : So in the ControlSignal, i've got angle of current (it is equal to 0), At the InSignal is the Voltage that i'm looking and if the voltage is greater than MaxPoint change the OutLoop witch 1st is = to ControlSignal to a value +1 So when that is done the Voltage is drop BUT if it is not enough to drop under MaxPoint to do it again. and again and again until InSignal is not bigger the MaxPoint. That's my point -> I change somethink ( in that case the current angle) that will change forsure the amplitude of Voltage (InSignal) Krasimir Terziev https://www.mathworks.com/matlabcentral/profile/authors/11473622 tag:www.mathworks.com,2005:Question/141488 2014-07-09T04:00:00Z 2021-01-21T09:06:50Z Where are the installers for Microsoft's Visual C++ Redistributable 2005 and 2008 libraries located? I know that MATLAB and the MATLAB Installer are dependent on several Microsoft Visual C++ Redistributable libraries. I would like to pre-install them, or need to re-install them for troubleshooting purposes. Where can I find the exact libraries that MATLAB uses?  MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/719570 2021-01-18T02:58:29Z 2021-01-21T09:06:01Z Hello everyone, I would like to ask a question how to parameterize data points? The method of parameterization of data points is as follows: Wesley https://www.mathworks.com/matlabcentral/profile/authors/19428999 tag:www.mathworks.com,2005:Question/715618 2021-01-13T09:17:25Z 2021-01-21T09:04:22Z Statup script executes as a function Hi there, I defined a startup.m script to excute when I start MatLab. I followed all of the instructions in Specify Startup Options. When I start MatLAb, I get the following error lines Attempt to execute SCRIPT startup as a function: C:\Users\antho\Documents\MATLAB\StartupDir\startup.m Hopefully the startup script does work properly! But it is very anoying to have that "error sound" and message that appears everytime I run MatLab ... Here is my startup.m file set(groot, ... 'defaultAxesFontSize',14, ... 'defaultAxesLabelFontSize',1.35, ... 'defaultTextFontSize',14, ... 'defaultTextFontSizeMode','manual',... 'defaultLegendFontSize',18, ... 'defaultLegendFontSizeMode','manual',... ... 'defaultTextInterpreter','latex',... 'defaultAxesTickLabelInterpreter','latex',... 'defaultLegendInterpreter','latex',... ... 'defaultLineLineWidth',2, ... ... 'defaultAxesXGrid','on', ... 'defaultAxesYGrid','on', ... 'defaultLegendBox','on', ... 'defaultLegendLocation', 'northeast',... 'defaultAxesBox', 'on' ... ) %% Check disp('statup.m all done!'); It isn't a function, and it should not be one! Do anyone knows how to fix this ? Thanks! Anthony. Anthony Amorosi https://www.mathworks.com/matlabcentral/profile/authors/11176013 tag:www.mathworks.com,2005:Question/722808 2021-01-21T07:54:26Z 2021-01-21T09:02:54Z why didn't the event function detect the events? Hi all! I'm solving the thermostat model, which presents the characteristic of hybrid dynamical systems, when the ith (here i=1,2) room's temperature reduces to T_ref-0.5, the thermal is off, when the ith (here i=1,2) room's temperature raises to T_ref+0.5, the thermal is on, I use the ode suits with events, but it failed, plus the program also runs a long time, about 40 seconds(performance of computer is not bad), can anyone help me to fix the problem? This is ode45 codes, but failed. tic %options=odeset('Events',@Events1,'Events',@Events2,'AbsTol',1e-8,'RelTol',1e-8); options=odeset('AbsTol',1e-8,'RelTol',1e-8); y0 = [21;25;17]; tspan=0:1000; [tout,yout]=ode45(@Tq_Tj,tspan, y0,options); figure(1) plot(tout,yout(:,1),'k');hold on plot(tout,yout(:,2),'-.'); plot(tout,yout(:,3),'--'); legend('room1','room2','wall') toc function f=Tq_Tj(~,y) C1=550;C2=600;Cw=580;R1=1.8;R2=2.2;R1w=2;R2w=2;Ta=32;p1=14;p2=14;T_ref=20; if(y(1)>T_ref+0.5) p1=14; elseif(y(1)<T_ref-0.5) p1=0; end if(y(2)>T_ref+0.5) p2=14; elseif(y(2)<T_ref-0.5) p2=0; end f=[((Ta-y(1))/R1+(y(3)-y(1))/R1w-p1)/C1; ... ((Ta-y(2))/R2+(y(3)-y(2))/R2w-p2)/C2;... ((y(1)-y(3))/R1w+(y(2)-y(3))/R2w)/Cw]; end function [g,isterminal,direction]=Events1(~,y) T_ref=20; g=[y(1)-(T_ref-0.5);y(1)-(T_ref+0.5)]; isterminal=[0;0]; direction=[0;0]; end function [g,isterminal,direction]=Events2(~,y) T_ref=20; g=[y(2)-(T_ref-0.5);y(2)-(T_ref+0.5)]; isterminal=[0;0]; direction=[0;0]; end this is another way to solve the problem, you can run it to get the right results. clc clear tic %为各变量赋初值 delta_q=1e-4; q1=21;q2=25;q3=17; x1=q1;x2=q2;x3=q3; t=0;delta_t=0; A=zeros(10,6); n=0; C1=550;C2=600;Cw=580;R1=1.8;R2=2.2;R1w=2;R2w=2;Ta=32;p1=14;p2=14;m1=1;m2=1;T_ref=20; %C1=0.56;C2=0.28;Cw=0.2;R1=5;R2=6;R1w=3;R2w=3;Ta=20;p1=4;p2=4;m1=1;m2=1;T_ref=20; %开始while循环 while (t<1000) if(x1>T_ref+0.5) m1=1; elseif(x1<T_ref-0.5) m1=0; end if(x2>T_ref+0.5) m2=1; elseif(x2<T_ref-0.5) m2=0; end Dx1=((Ta-q1)/R1+(q3-q1)/R1w-m1*p1)/C1; Dx2=((Ta-q2)/R2+(q3-q2)/R2w-m2*p2)/C2; Dx3=((q1-q3)/R1w+(q2-q3)/R2w)/Cw; DDx1=(-Dx1/R1+(Dx3-Dx1)/R1w)/C1; DDx2=(-Dx2/R2+(Dx3-Dx2)/R2w)/C2; DDx3=((Dx1-Dx3)/R1w+(Dx2-Dx3)/R2w); DDDx1=(-DDx1/R1+(DDx3-DDx1)/R1w)/C1; DDDx2=(-DDx2/R2+(DDx3-DDx2)/R2w)/C2; DDDx3=((DDx1-DDx3)/R1w+(DDx2-DDx3)/R2w); %求Δt1和Δt2的值 delta_t1=sqrt(2*delta_q/abs(DDx1)); delta_t2=sqrt(2*delta_q/abs(DDx2)); delta_t3=sqrt(2*delta_q/abs(DDx3)); delta_tmin=min([delta_t1 delta_t2 delta_t3]); %比较Δt1和Δt2的大小，进而确定q1和q2谁先跃迁 if (delta_t1==delta_tmin) delta_t=delta_t1; t=t+delta_t; caribe_1=-0.125*DDDx1*(exp(-2*delta_t)-1)+0.5*(DDx1+0.5*DDDx1)*delta_t^2+(Dx1-0.25*DDDx1)*delta_t; caribe_2=-0.125*DDDx2*(exp(-2*delta_t)-1)+0.5*(DDx2+0.5*DDDx2)*delta_t^2+(Dx2-0.25*DDDx2)*delta_t; caribe_3=-0.125*DDDx3*(exp(-2*delta_t)-1)+0.5*(DDx3+0.5*DDDx3)*delta_t^2+(Dx3-0.25*DDDx3)*delta_t; x1=x1+caribe_1; x2=x2+caribe_2; x3=x3+caribe_3; q1=x1; q2=q2+caribe_2; q3=q3+caribe_3; elseif (delta_t2==delta_tmin) delta_t=delta_t2; t=t+delta_t; caribe_1=-0.125*DDDx1*(exp(-2*delta_t)-1)+0.5*(DDx1+0.5*DDDx1)*delta_t^2+(Dx1-0.25*DDDx1)*delta_t; caribe_2=-0.125*DDDx2*(exp(-2*delta_t)-1)+0.5*(DDx2+0.5*DDDx2)*delta_t^2+(Dx2-0.25*DDDx2)*delta_t; caribe_3=-0.125*DDDx3*(exp(-2*delta_t)-1)+0.5*(DDx3+0.5*DDDx3)*delta_t^2+(Dx3-0.25*DDDx3)*delta_t; x1=x1+caribe_1; x2=x2+caribe_2; x3=x3+caribe_3; q2=x2; q1=q1+caribe_1; q3=q3+caribe_3; elseif (delta_t3==delta_tmin) delta_t=delta_t3; t=t+delta_t; caribe_1=-0.125*DDDx1*(exp(-2*delta_t)-1)+0.5*(DDx1+0.5*DDDx1)*delta_t^2+(Dx1-0.25*DDDx1)*delta_t; caribe_2=-0.125*DDDx2*(exp(-2*delta_t)-1)+0.5*(DDx2+0.5*DDDx2)*delta_t^2+(Dx2-0.25*DDDx2)*delta_t; caribe_3=-0.125*DDDx3*(exp(-2*delta_t)-1)+0.5*(DDx3+0.5*DDDx3)*delta_t^2+(Dx3-0.25*DDDx3)*delta_t; x1=x1+caribe_1; x2=x2+caribe_2; x3=x3+caribe_3; q3=x3; q1=q1+caribe_1; q2=q2+caribe_2; end n=n+1; A(n,1)=t; A(n,2)=x1; A(n,3)=x2; A(n,4)=x3; A(n,5)=m1; A(n,6)=m2; end % A; figure(2); plot(A(:,1),A(:,2),'--');hold on plot(A(:,1),A(:,3),'-.'); plot(A(:,1),A(:,4),'-'); grid on % plot(A(:,1),A(:,5)*22);hold on % plot(A(:,1),A(:,6)*22); legend('room1','room2','wall') toc 汉武 沈 https://www.mathworks.com/matlabcentral/profile/authors/20385258 tag:www.mathworks.com,2005:Question/126078 2013-10-25T04:00:00Z 2021-01-21T09:02:32Z How do I use MATLAB in English on my Chinese machine? I would like to know if there is a way to get MATLAB in English on my Chinese machine. MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/704452 2020-12-29T09:17:24Z 2021-01-21T09:01:20Z How to export the overview table from the Experiment Manager App I started using the Experiment Manager App to explore a Neural Network performance on a calssification task and how it depends on the hyperparameters of the model. https://ch.mathworks.com/help/deeplearning/ref/experimentmanager-app.html The overall design of the App is quite appealing for a first look but the options for exporting the results for further analysis are too limited. After a hyperparameter sweep the app displays a table of results that displays the accuracy and loss for each trial together with the choosen hyperparameters. It would be extreemly useful to export this table e.g. to plot validation and test accuracy as function of the hyperparameters to gain more insights. However I could not find such an export option. It is only possible to export the parameters of individual trained Networks. Please let me know if this option exists? If not, It would be great if such an export option could be added to the app. Or if a function could be provided to extract the results parameters from the results subfolders. Thanks and Kind Regards Sebastian Landwehr Sebastian Johannes Heinz-Josef Landwehr https://www.mathworks.com/matlabcentral/profile/authors/20722347 tag:www.mathworks.com,2005:Question/652138 2020-11-18T13:39:45Z 2021-01-21T09:01:18Z Error while using smimport I am receiving an error: 'Error using smimport_implementation' when using the 'smimport' function to import a CAD model into Simscape Multibody. I have copied the command window readout below. Error using smimport_implementation Workspace for block diagram 'sm_robot' was not loaded because an error occurred while loading the MATLAB-file 'C:\Program Files\MATLAB\R2018b\bin\win64\sm_robot_DataFile.m'. Error in smimport (line 167) [varargout{1:nargout}] = smimport_implementation(multibodyDescriptionFile, varargin{:}); Caused by: Error using smimport_implementation Undefined function or variable 'sm_robot_DataFile'. I have seen the previous answer to a similar question in 2017, but the issue that caused the error has been fixed in the release I am using: R2018b. The line in the function smimport is also line 167 not 132 as in the older question. This error is even happening with the demo XML file: sm_robot. I have checked that the data file has been generated and I can open it and view it. How can I rectify this error so that the multibody block diagram builds without errors? Sam Hayward https://www.mathworks.com/matlabcentral/profile/authors/16477968 tag:www.mathworks.com,2005:Question/126047 2014-02-10T05:00:00Z 2021-01-21T08:59:15Z Why doesn't my Student Version Activation Key or Serial Number fit in the Activation Screen? Why doesn't my Student Version Activation Key or Serial Number fit in the Activation Screen? I am not able to activate my software. MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/721954 2021-01-20T10:13:16Z 2021-01-21T08:58:53Z How to print ? Plot the following polynomial using linear/linear scale, log/linear scale, linear/log scale and log/log scale. y=4(x)^2 + 8x +1 Mihir Trivedi https://www.mathworks.com/matlabcentral/profile/authors/21017016 tag:www.mathworks.com,2005:Question/96973 2009-06-27T01:11:00Z 2021-01-21T08:57:19Z How can I concatenate or merge two structures? I would like to merge two structures into a new structure containing all the fields of the two original structures. How can I do this in MATLAB? MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/722828 2021-01-21T08:51:10Z 2021-01-21T08:53:22Z Vehicle suspension design problem in simscape hello, I am trying to design the model of suspension in simsape. the rough drawing of suspension is attached. I tried to develope simscape model for the same and capture the force at the spring but not getting exected results from the model. input is 100mm step input from road. the input replicated the 100mm wheel travel while passing any bump. Fig.1: actual suspension system rough drawing for reference Fig.2: Simscape model for the suspension system Input from input scope: Output: Parag Bendre https://www.mathworks.com/matlabcentral/profile/authors/15912846 tag:www.mathworks.com,2005:Question/722833 2021-01-21T08:52:21Z 2021-01-21T08:52:21Z how to change color images Hi all, i try to fuse between two image. my coding as below, and my picture as attached. B = dicomread('TRANSA001_CT025.dcm'); A = dicomread('PETWB001_PT025.dcm'); scale = 512/256 C = imresize(B,scale); imhowpair(C,B) My question is, how to change my color for C and B? i want different color for both. so that i easy to see which one is C, and which one is B. Anyone can help me? mohd akmal masud https://www.mathworks.com/matlabcentral/profile/authors/10957567 tag:www.mathworks.com,2005:Question/722783 2021-01-21T07:09:17Z 2021-01-21T08:50:54Z How to add tolerance for isequal? Hi, I am comparing two .mat files, both have very complicated struct type data but they should be almost identical. In this case, I don't found other method except for isequal can perform the comparsion. data = load('MMC4_cpu_HVDC.mat'); data_ref = load('MMC4_cpu_HVDC_ref.mat'); isequal(data,data_ref) The code above produced ans = 0. I checked using visdiff, found that it is due to some very small difference in number. visdiff('MMC4_cpu_HVDC.mat', 'MMC4_cpu_HVDC_ref.mat') % 13.581349668075767 % ans = % 13.5813 % 13.581349668075765 % ans = % 13.5813 I would like to ask if it is possible to add a tolerance factor to isequal? or are there other ways to compare these two .mat files? Example data are attached. Many thanks. Andy And Meng https://www.mathworks.com/matlabcentral/profile/authors/9534027 tag:www.mathworks.com,2005:Question/719345 2021-01-17T17:20:39Z 2021-01-21T08:50:08Z Run regressions and output the result as a report using "Report Generator" I run regressions such as fitlm(T.population, T.sales) I want to output a report that explains these regression equations and comments output of fitlm I looked at "Matlab Report Generator" https://www.mathworks.com/products/matlab-report-generator.html but I do not see an example that helps me get started. Thank you. alpedhuez https://www.mathworks.com/matlabcentral/profile/authors/10930090 tag:www.mathworks.com,2005:Question/722558 2021-01-20T22:21:09Z 2021-01-21T08:49:46Z Raspberry Pi for Matlab/Simulink I2C slave mode Hi, When is I2C slave mode is coming for the official hardware support package for Raspberry Pi? It is really frustirating to do communications with other MCU's while the "other" MCU is reading all the data in high frequencies from other periphrals, therefore the other MCU is the master in the SDA/SCL line and Raspi needs the data. Best. Ege Gediksiz https://www.mathworks.com/matlabcentral/profile/authors/5079835 tag:www.mathworks.com,2005:Question/722314 2021-01-20T17:29:33Z 2021-01-21T08:46:19Z How to find out a smallest sub-matrix B from a sparse matrix A which has the equal rank and # of non-zero columns? Dear All, I have a very sparse matrix A. I need to find out a number of rows (smallest #) of A which satisfies the following conditions: 1). Let us suppose the number of rows form a sub-matrix B. In another word, for a given matrix A, we need to find out sub-matrix B; 2). Matrix B must contain the first row of A; 3). The rank of B must be equal to the number of non-zero columns (a non-zero column is defined as a column containing at least one non-zero element in the column) of B. 4). The rank of B must be smaller than the row number of matrix A. For example, A = [ 1 -1 0 0 0 0 2 0 0 0 0 0 2 -1 -1 1 0 1 0 0 ]; The anwser is obvious. The matrix B is formed by the first 2 rows of A: B = [ 1 -1 0 0 0 0 2 0 0 0 ]; The condition is satisfied: rank(B) = # of non-zero columns (the first 2 columns are non-zero columns) in B. How about the following example? A = [ 1 -1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 0 -1 -1 0 0 0 -1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 -1 0 0 0 4 -1 -1 -1 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 -1 0 1 0 0 0 0 0 0 -1 0 0 2 0 0 0 0 0 0 0 0 0 0 3 -1 0 0 -1 0 0 0 -1 -1 1 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 1 ]; Please help to find out a sub-matrix B for a given sparse matrix A. Thanks a lot. Benson Benson Gou https://www.mathworks.com/matlabcentral/profile/authors/4652929 tag:www.mathworks.com,2005:Question/722004 2021-01-20T11:11:11Z 2021-01-21T08:44:32Z How can i count how many time a number appears and for how long in a vector? I have a vector like this v=[+1 +1 +1 0 0 0 +1 +1 -1 -1 +1 0 0 -1 -1 +1 +1] I want to count how many times each number appears and for how long. i mean, for example let's consider +1. it appears indivigually only 1 time, then it appears in couple 2 times, then it appear in triplet only 1 time and so on. Could someone help me? thank you! salvatore vergine https://www.mathworks.com/matlabcentral/profile/authors/17712621 tag:www.mathworks.com,2005:Question/110332 2013-11-19T05:00:00Z 2021-01-21T08:39:16Z Why is my Network License Manager log file encoded and unreadable? I am trying to review the log file for my Network License Manager, but the file is encoded and unreadable.  MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/721789 2021-01-20T04:33:57Z 2021-01-21T08:39:15Z IMAGE BINARIZE determine THRESHOLD Hi, i have one set data image grey scale. pixel value from 0 - 1300. Then i want to threshold is 1300*0.4 = 520 . then the pixel number greater than 520 is 1, the pixel value smaller than 520 is 0. Then this is my coding, spect = dicomread ('astitr8sub32.dcm'); MAX = max(max(max(spect))); T = MAX*0.4; PVmin = T; PVmax = MAX; spect(spect<PVmin)=0; spect(spect>PVmax)=0; spect(spect~=0)=1; spectmax=max(max(max(spect)); spectmin=min(min(min(spect))); spectrange=spectmax-spectmin; now i want convert my grey scale to binary image using function adaptthresh, spect = dicomread ('astitr8sub32.dcm'); MAX = max(max(max(spect))); T = adaptthresh(spect, 0.4); BW = imbinarize(spect, T); spect(spect==BW)=0; spect(spect==BW)=1; spectmax=max(max(max(spect))); spectmin=min(min(min(spect))); spectrange=spectmax-spectmin; BUT i GOT ERROR. CAN SOME ONE HELP ME? mohd akmal masud https://www.mathworks.com/matlabcentral/profile/authors/10957567 tag:www.mathworks.com,2005:Question/722823 2021-01-21T08:38:01Z 2021-01-21T08:38:01Z Wireless communication between 2 Simulink blocks without Goto/From Hi, Would there be a way to create 2 Simulink blocks (Matlab Function? S-Function ?) that would be in a same model, at different levels and which could communicate together wirelessly? I'm looking for a solution that do not use Goto/From blocks. I'm pretty sure there is a code solution, surely complicated, but the outlines of this solution are not clear in my mind. GL langrg https://www.mathworks.com/matlabcentral/profile/authors/14259426 tag:www.mathworks.com,2005:Question/722079 2021-01-20T12:43:49Z 2021-01-21T08:37:38Z Generate a geographical heat map Hello, I am trying to generate a heat map on mapping toolbox. Here I have the coordinates of the centers in my grid: Lat = 54.2 + 0.1/6 * [11 9 7 5 3 1]' * ones(1,3) ; Lon = 9.15 + 0.025 * ones(6,1) * [1 3 5] ; coord = [ [Lat(:,1) , Lon(:,1)] ; [Lat(:,2) , Lon(:,2)] ; [Lat(:,3) , Lon(:,3)] ] ; So coord is a 18 by 2 matrix, referring to the coordinates of 18 points. Let us assume I want to assign a random value to each point, then I can define values = rand(18, 1) . How can I generate a heat map with such values in such locations? How can I make each 'pixel' of the heat map like a sqare with size 0.05 by 0.033 degrees in longitude and latitude? Thank you in advance for your help :) Maurilio Matracia https://www.mathworks.com/matlabcentral/profile/authors/15893658 tag:www.mathworks.com,2005:Question/722054 2021-01-20T12:11:21Z 2021-01-21T08:34:42Z Using Matlab omn others Softwares Hey, In my Project I need to control a software (AD5933 REV1.0, from Analog Devices) using Matlab. Can I do it? And If I can how is it done? sincerely, Aviad aviad m https://www.mathworks.com/matlabcentral/profile/authors/8952421 tag:www.mathworks.com,2005:Question/102960 2013-06-17T20:15:00Z 2021-01-21T08:27:14Z Why am I not able to play videos on the MathWorks website? When I am on the MathWorks web site and I try to play a video, the page loads but the video doesn&#39;t play. MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/103035 2012-12-12T17:05:00Z 2021-01-21T08:25:48Z How do I add a hat on a character which is displayed in the LEGEND of a figure in MATLAB 7.0 (R14)? I would like to add a hat on a character in a string which is displayed in the legend of a figure in MATLAB 7.1 (R14SP3). MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/718675 2021-01-16T17:26:32Z 2021-01-21T08:19:48Z how to reset drop down list(go to first option) when pushing any other button in App designer how can i reset drop down list (go to first option) when pushing any other button in App designer? Hikmet Osman https://www.mathworks.com/matlabcentral/profile/authors/19282290 tag:www.mathworks.com,2005:Question/722094 2021-01-20T12:50:38Z 2021-01-21T08:19:24Z How to use the state port of an integrator block in Simulink? Hi, I want to use the state port for initial value of the integrator when it resets. However, I get an error message when I treat it like the output port by adding it with a sumblock to equal-sized state vector, by using a delay block on the signal. The following message occurs regularly: State ports can only be used to break algebraic loops or to "hand-off" states between systems. Use the output port rather than the state port of 'untitled/Integrator' as the source of the signal routed (either by direct or virtual connection) to 'untitled/Sample and Hold' Can someone elaborate on what the state port exactly is? I don't really understand from what I can find about on the internet. David Baas https://www.mathworks.com/matlabcentral/profile/authors/18471663 tag:www.mathworks.com,2005:Question/126903 2014-04-23T04:00:00Z 2021-01-21T08:17:55Z Why does MATLAB R2013b, R2014a crash when using Mac OS X? MATLAB R2013b and R2014a have been crashing frequently when used in Mac OS X for various reasons: a) Sometimes it happens when plugging/unplugging external monitors or displays b) Sometimes it happens after the computer wakes from or the screen saves goes off. At times I noticed the crash would not happen right away after any of the above events, but would happen a little after when I would open a new figure, execute code, etc. The crash produces the following log:   [  0] 0x000000010715c874 /Applications/MATLAB_R2014a.app/bin/maci64/libmwfl.dylib+00030836 _ZN2fl4diag15stacktrace_base7captureERKNS0_14thread_contextEm+00000052 [  1] 0x00000001071602aa /Applications/MATLAB_R2014a.app/bin/maci64/libmwfl.dylib+00045738 _ZN2fl4test17terminate_handledEv+00000906 [  2] 0x000000010715fcf5 /Applications/MATLAB_R2014a.app/bin/maci64/libmwfl.dylib+00044277 _ZN2fl4diag13terminate_logEPKcPK17__darwin_ucontext+00000117 [  3] 0x0000000106cd8d07 /Applications/MATLAB_R2014a.app/bin/maci64/libmwmcr.dylib+00269575 _Z32mnRunPathDependentInitializationv+00003127 [  4] 0x0000000106cd8ff8 /Applications/MATLAB_R2014a.app/bin/maci64/libmwmcr.dylib+00270328 _Z32mnRunPathDependentInitializationv+00003880 [  5] 0x0000000106cd681a /Applications/MATLAB_R2014a.app/bin/maci64/libmwmcr.dylib+00260122 mnFatalSignalHandler+00000298 [  6] 0x00007fff969615aa           /usr/lib/system/libsystem_platform.dylib+00013738 _sigtramp+00000026 [  7] 0x0000000000000002                                   &lt;unknown-module&gt;+00000000 [  8] 0x0000000117a39647 /Applications/MATLAB_R2014a.app/sys/java/jre/maci64/jre/lib/lwawt/liblwawt.dylib+00206407 __Java_sun_lwawt_macosx_CWrapper_00024NSObject_release_block_invoke_1+00000091 [  9] 0x00000001168715f5 /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation+00026101 +[JNFRunLoop _performCopiedBlock:]+00000020 [ 10] 0x00007fff8d1f213e /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation+00405822 __NSThreadPerformPerform+00000229 Why does this happen? MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/722234 2021-01-20T15:54:24Z 2021-01-21T08:14:32Z How do I measure density of random point with a fixed area in MATLAB? There had a 9x9 area and I have generate a lot of point with this area in random. How do I measure density of the red point (e.g. Bottom left). Somebody can give something sample code to let me study with this topic? It is very helpful to my project research. Chun Yin Lui https://www.mathworks.com/matlabcentral/profile/authors/13915382 tag:www.mathworks.com,2005:Question/626568 2020-10-26T15:06:30Z 2021-01-21T08:12:38Z Not sure of how I can sample this Nyquist wave? Combining data problems I was given a task of creating a continuous time signal consisting of two different sine waves added together, with this new wave then being sampled after its creation. I managed to complete the first part with ease by making two different sets of data and combining them to make a new sine. Though there came an issue with it, as I could not properl use the stem function to discretely "sample" the data. This is what I got for my initial output: https://gyazo.com/f15f83d7f9824ae8cfed10fac1629e93 As you can see, while the wave did end up fine in the end, discrete data was all over the place as you can see with the blue lines not fitting at all into the wave. This is what I was supposed to get for my output: https://gyazo.com/52423e5ae12e9b62fcbd88103c4465c4 Over in this image, you can see that the lines fit; the data is being correctly sampled discretely. This is the code I used to get my intial output %Time Base t = 0:0.001:1.8; %Nyquist Frequencies Fn1 = 1; Fn2 = 6; %Nyquist Rates Fnr1 = 2*(Fn1); Fnr2 = 2*(Fn2); %Sampling Period Sp1 = 5*(Fnr1); Sp2 = 5*(Fnr2); Ts1 = 1/(Sp1); Ts2 = 1/(Sp2); T1 = 1/(Fn1); T2 = 1/(Fn2); %Number of Samples N1 = (T1/Ts1); n1 = 0:1:N1; N2 = (T2/Ts2); n2 = 0:1:N2; nTs1 = n1 * Ts1; nTs2 = n2 * Ts2; x_c = sin(2*pi*Fn1*nTs1); x_c1 = sin(2*pi*Fn1*t); x_c2 = sin(2*pi*Fn2*nTs2); x_2 = sin(2*pi*Fn2*t); signal = x_c1 + x_2; ct = nTs1 + nTs2; nqsignal = x_c + x_c2; %Second Part h = stem(ct, nqsignal, 'linewidth', 2); hold plot(t, signal, 'linewidth', 2) lgd = legend('Discrete Data', 'Continuous Data'); set (lgd, "fontsize", 12) set(gca,'XTick',[0:0.2:1.8]); set(gca,'YTick',[-2:0.5:2]); title('Time vs Magnitude','fontweight','bold','fontsize',16); xlabel('Time(s)','fontweight','bold','fontsize',14) ylabel('Magnitude','fontweight','bold','fontsize',14) grid Joel Okanta https://www.mathworks.com/matlabcentral/profile/authors/17349091 tag:www.mathworks.com,2005:Question/574813 2020-08-04T07:57:20Z 2021-01-21T08:08:13Z Plotting a surface from a two-dimensional matrix Good day, I have the following problem: I've run a simulation that produces some signals depending on two variables. As my advisor told me, I made a python pipeline that saves the simulated signals on a file in a two-dimensional matrix, with the first two columns being the sweeps of the two variables in all the possible permutations. For example. assuming that the two variables have values [1 2 3] and [4 5 6], the first two columns would be: [1 4] [1 5] [1 6] [2 4] [2 5] [2 6] [3 4] [3 5] [3 6] Now i have to plot these signals on surfaces on a 3d plot. From what I know, to plot a surface one needs the "surf" command, that takes two vectos with dimensions N and M, plus a two-dimensional matrix with dimensions N x M. The only way that i can think of to obtain this in my case would be to build a new data matrix from scratch using a for cycle, to assign the values of the error signals to two-dimensional matrix, but it seems unefficient and lenghty. Am i missing something? Mattia Boldrini https://www.mathworks.com/matlabcentral/profile/authors/18629533 tag:www.mathworks.com,2005:Question/722134 2021-01-20T13:44:02Z 2021-01-21T08:06:04Z Please does anyone know how to import 3D .uv data from LC-UV agilent .D folder? I need to import the .uv file inside the .D folder from agilent LC-UV equipement. Please, does anyone have an ideia how to do it? Rafael Freire https://www.mathworks.com/matlabcentral/profile/authors/2343440 tag:www.mathworks.com,2005:Question/100609 2009-06-27T01:11:00Z 2021-01-21T07:40:45Z Why does the FPRINTF function round my double precision floating point number in MATLAB 6.5 (R13)? Why does the FPRINTF function round my double precision floating point number in MATLAB 6.5 (R13)? I am experiencing a formatting problem in MATLAB 6.5 (R13), where only the first 19 significant digits are printed correctly to a text file when I use the FPRINTF function. The script below shows that the data is stored internally with the correct precision, but not when it is printed to a text file. fid = fopen('out.txt','w+'); a = -0.00283527374267578125; fprintf(fid, '%.25f\n', a); fprintf('%.25f\n', a*2); fclose(fid); The result of printing "a" to a file: -0.0028352737426757813000000 -0.0056705474853515625000000 The number should be exactly representable in floating point format, since it is only a 20 bit binary number: Decimal Form: a = -0.00283527374267578125; Hexidecimal Form (format hex): a = bf673a0000000000; I am inclined to think the problem is concerned with how MATLAB converts the floating point number to a decimal when using the FPRINTF function. MathWorks Support Team https://www.mathworks.com/matlabcentral/profile/authors/4622813 tag:www.mathworks.com,2005:Question/458900 2019-04-27T18:27:17Z 2021-01-21T07:39:39Z Multiple Input Single Output Segmentation using Deep Learning I have 4 modal volumetric image data and output segemented data. I have to create a multi input DAG network, and I have succesfully created it using lgraph.. But I cannot able to train the network using trainNetwork. It shows error that only one input can be feed to trainNetwork.. My code is below, store1, store2, store3, store4 are four input 3d datastore and pxd is the output datastore inputSize = [64 64 64]; layers1 = [ image3dInputLayer(inputSize,'Normalization','none','Name','input1') convolution3dLayer(3,155,'Padding','same','Name','conv_11') maxPooling3dLayer(4,'Name','maxpool1')]; layers2=[ image3dInputLayer(inputSize,'Normalization','none','Name','input2') convolution3dLayer(3,155,'Padding','same','Name','conv_21') maxPooling3dLayer(4,'Name','maxpool2')]; layers3=[ image3dInputLayer(inputSize,'Normalization','none','Name','input3') convolution3dLayer(3,155,'Padding','same','Name','conv_31') maxPooling3dLayer(4,'Name','maxpool3')]; layers4=[ image3dInputLayer(inputSize,'Normalization','none','Name','input4') convolution3dLayer(3,155,'Padding','same','Name','conv_41') maxPooling3dLayer(4,'Name','maxpool4')]; concat1=concatenationLayer(3,4,'Name','depth_1'); outlayer=[ transposedConv3dLayer(3,620,'stride',2,'cropping','same','Name','tconv_o1') convolution3dLayer(1,numLabels,'Name','convLast'); softmaxLayer('Name','softmax'); dicePixelClassification3dLayer('output')]; lgraph = layerGraph; lgraph = addLayers(lgraph,layers1); lgraph = addLayers(lgraph,layers2); lgraph = addLayers(lgraph,layers3); lgraph = addLayers(lgraph,layers4); lgraph = addLayers(lgraph,concat1); lgraph = addLayers(lgraph,outlayer); lgraph = connectLayers(lgraph,'maxpool1','depth_1/in1'); lgraph = connectLayers(lgraph,'maxpool2','depth_1/in2'); lgraph = connectLayers(lgraph,'maxpool3','depth_1/in3'); lgraph = connectLayers(lgraph,'maxpool4','depth_1/in4'); lgraph = connectLayers(lgraph,'depth_1','tconv_o1'); plot(lgraph) miniBatchSize = 1; options = trainingOptions('rmsprop', ... 'MaxEpochs',1, ... 'InitialLearnRate',0.01, ... 'LearnRateSchedule','piecewise', ... 'LearnRateDropPeriod',5, ... 'LearnRateDropFactor',0.95, ... 'Plots','training-progress', ... 'Verbose',false, ... 'MiniBatchSize',miniBatchSize); [net,info] = trainNetwork({store1,store2,store3,store4},pxds,lgraph,options); Error shown is Error in line: [net,info] = trainNetwork({store1,store2,store3,store4},pxds,lgraph,options); Caused by: Network: Too many input layers. The network must have one input layer. Detected input layers: layer 'input1' layer 'input2' layer 'input3' layer 'input4' Please help me to solve this problem or suggest another way to train multi input image data Koshy https://www.mathworks.com/matlabcentral/profile/authors/3928210 tag:www.mathworks.com,2005:Question/722743 2021-01-21T06:18:07Z 2021-01-21T07:39:26Z Exporting data from .h5 file to matlab I am having troubles to export a file from a .h5 file format to matlab, the code runs successfully but matlab plot/ figure does not show up. Does anyone know what is the issue with the code? Thanks. clear vars; close all; clc; format compact; filename = "data.h5"; info = h5info(filename); disp("Keys =") for i = 1:size(info.Datasets) name = info.Datasets(i).Name; fprintf(" %s\n", name); end mode = string(h5read(filename, "/mode")) sensor_config = jsondecode(string(h5read(filename, "/sensor_config_dump"))) session_info = jsondecode(string(h5read(filename, "/session_info"))) data = h5read(filename, "/data"); disp("Data size =") disp(size(data)) % Dimensions (frame, sensor, depth) for Envelope, IQ, Power bins % (frame, sensor, sweep, depth) for Sparse if ndims(data) == 3 % Not sparse range_start = sensor_config.range_interval(1); range_end = sensor_config.range_interval(2); depths = linspace(range_start, range_end, size(data, 3)); frames = 1:size(data, 1); data_from_first_sensor = squeeze(data(:, 1, :)); plot_data = abs(data_from_first_sensor); imagesc(frames, depths, plot_data).show() xlabel("Sweeps") ylabel("Depth") end data_info = jsondecode(string(h5read(filename, "/data_info"))); first_data_info = data_info(1, 1) % (frame, sensor) rss_version = string(h5read(filename, "/rss_version")) lib_version = string(h5read(filename, "/lib_version")) timestamp = string(h5read(filename, "/timestamp")) Chloe Loh https://www.mathworks.com/matlabcentral/profile/authors/19184076 tag:www.mathworks.com,2005:Question/722683 2021-01-21T03:29:07Z 2021-01-21T07:38:13Z Is there anyway to calculate the position in coordinates of points using a n*n distance matrix? if there are n points in a 2-D coordinate, it is relatively easy to calculate the distance matrix using their positions. However, can we calculate the position of n points using a n*n distance matrix? And, will there be more than one solution? Results with the same "shape" should be viewed as one solution. Say, if there are only 3 points and a 3*3 distance matrix, it is very easy to obtain a triangle with only one possible shape. But if n > 3, will it also stand? Meme Young https://www.mathworks.com/matlabcentral/profile/authors/12013418 tag:www.mathworks.com,2005:Question/718310 2021-01-16T02:53:30Z 2021-01-21T07:37:06Z Matlab license expiration, now? Now I get this message when I open Matlab: ---------------------------------------------------- Your MATLAB license will expire in 14 days. Please contact your system administrator or MathWorks to renew this license. ---------------------------------------------------- Bobby Fischer https://www.mathworks.com/matlabcentral/profile/authors/17553780 tag:www.mathworks.com,2005:Question/420155 2018-09-21T14:37:39Z 2021-01-21T07:36:44Z how to use coolprop In following the instructions on: http://www.coolprop.org/coolprop/wrappers/MATLAB/index.html#matlab and executing: >> CoolProp.PropsSI('T','P',101325,'Q',0,'Water') produces the following errors: Warning: function AbstractState_d4alphar_dDelta3_dTau takes at most 1 arguments > In CoolProp.PropsSI (line 2) Error using CoolPropMATLAB_wrap Fatal error. Error in CoolProp.PropsSI (line 2) [varargout{1:max(1,nargout)}] = CoolPropMATLAB_wrap(345,varargin{:}); I have not found literature on error codes. I would appreciate any help in identifying how to start this up, general use instructions, and trouble shooting actions. Ray Joseph https://www.mathworks.com/matlabcentral/profile/authors/13263262 tag:www.mathworks.com,2005:Question/722798 2021-01-21T07:29:46Z 2021-01-21T07:29:46Z Problem with Matlab when calling COM/ActiveX Hi everyone, Does anyone here could help me with this problem. These codes below were written in different languages and they pass nine arguments to the function: (Visual Basic .NET} Dim boolstatus As Boolean = false boolstatus = swModelExtension.SelectByID2("Point1", "SKETCHPPOINT", .2, .3, 0, False, 0, Nothing, swSelectOptionDefault) (Visual Basic for Applications (VBA)) Dim Result as Boolean Result = swModelExtension.SelectByID2("Point1", "SKETCHPOINT", .2, .3, 0, False, 0, Nothing, swSelectOptionDefault) (C#) bool boolstatus = false; boolstatus = swModelExtension.SelectByID2("Point1", "SKETCHPOINT", .2, .3, 0, false, 0, null, swSelectOptionDefault); (Unmanaged C++ COM) VARIANT_BOOL Result = FALSE; HRESULT hres = swModelExtension->SelectByID2(_T("Point1"),_T("SKETCHPOINT"),.2,.3, 0,0,0,0,swSelectOptionDefault,&result); My problem is that I want to convert it to Matlab using COM/ActiveX method. I have tried with matlab code as below, however it DID NOT' work: mystatus=invoke(swModelExtension,'SelectByID2','Point1','SKETCHPOINT','.2','.3','0','0','0','0','swSelectOptionDefault'); Please help me to solve this problem. Thank you in advance. Son Trinh-Van https://www.mathworks.com/matlabcentral/profile/authors/21012422 tag:www.mathworks.com,2005:Question/722244 2021-01-20T15:58:52Z 2021-01-21T07:29:25Z How to write name inside polygon? After create a polygon how to write name inside it so you can differeniate between it and the other polygons? ZeKkEn NoName https://www.mathworks.com/matlabcentral/profile/authors/20819963 tag:www.mathworks.com,2005:Question/722793 2021-01-21T07:28:17Z 2021-01-21T07:28:17Z Good day everyone, do anyone knows the commands to plot these 2 equations in a graph? 1st function blue colour and 2nd in red... and I'm using R2020b. Jashveendas N. Kannadhas https://www.mathworks.com/matlabcentral/profile/authors/20434200