Category: Matlab
Category Archives: Matlab
Limit angle in [-90, 90] degree
As I was using ode45 to solve ODEs, I do not know to limit the result in [-90,90] degree. Anyone may provide some help?As I was using ode45 to solve ODEs, I do not know to limit the result in [-90,90] degree. Anyone may provide some help? As I was using ode45 to solve ODEs, I do not know to limit the result in [-90,90] degree. Anyone may provide some help? ode45, angle MATLAB Answers — New Questions
simulation does not work
Check your internet connection and proxy settings in MATLAB Web preferences and then try starting the feature again.
Detailed information:
Error code: -202
Error message: ERR_CERT_AUTHORITY_INVALIDCheck your internet connection and proxy settings in MATLAB Web preferences and then try starting the feature again.
Detailed information:
Error code: -202
Error message: ERR_CERT_AUTHORITY_INVALID Check your internet connection and proxy settings in MATLAB Web preferences and then try starting the feature again.
Detailed information:
Error code: -202
Error message: ERR_CERT_AUTHORITY_INVALID authority MATLAB Answers — New Questions
how to convert a monochrome image of depth 24 bits into a monochrome image of depth 8 bits ?
this is to convert a monochrome image of depth 24 bits into a monochrome image of depth 8 bits ?this is to convert a monochrome image of depth 24 bits into a monochrome image of depth 8 bits ? this is to convert a monochrome image of depth 24 bits into a monochrome image of depth 8 bits ? converstion of 24 bits to 8 bits depth MATLAB Answers — New Questions
How do I convert table data to double to manipulate them?
I extract data from a table. When I retrieve an element, it is in table format, but I encounter an error when attempting to perform operations like multiplication. Is there a direct command or a series of steps to address this issue?I extract data from a table. When I retrieve an element, it is in table format, but I encounter an error when attempting to perform operations like multiplication. Is there a direct command or a series of steps to address this issue? I extract data from a table. When I retrieve an element, it is in table format, but I encounter an error when attempting to perform operations like multiplication. Is there a direct command or a series of steps to address this issue? table2array MATLAB Answers — New Questions
Reading image into 16 bit signed int
Hello,
How do I read an image into 16 bit signed integer array?
I tried using im2int16 in-built function, but I do not have Image Processing Toolbox. Please let me know if there is any other way to do it.
Also what is the difference between signed integer and double?
Thank you.Hello,
How do I read an image into 16 bit signed integer array?
I tried using im2int16 in-built function, but I do not have Image Processing Toolbox. Please let me know if there is any other way to do it.
Also what is the difference between signed integer and double?
Thank you. Hello,
How do I read an image into 16 bit signed integer array?
I tried using im2int16 in-built function, but I do not have Image Processing Toolbox. Please let me know if there is any other way to do it.
Also what is the difference between signed integer and double?
Thank you. image processing, digital image processing MATLAB Answers — New Questions
Variables cannot be recognized in app designer
I wrote a program in a script and it works, but it doesn’t work in app designer. The unrecognizable code is shown below (a part of the calling function). Thank you very much for your time.I wrote a program in a script and it works, but it doesn’t work in app designer. The unrecognizable code is shown below (a part of the calling function). Thank you very much for your time. I wrote a program in a script and it works, but it doesn’t work in app designer. The unrecognizable code is shown below (a part of the calling function). Thank you very much for your time. appdesigner MATLAB Answers — New Questions
How to change the rigid transform parameters between two frames during simulation in MultiBody Simscape?
Hi, is there any way how to change the rigid transform parameters between two frames during simulation in MultiBody Simscape? Ideally, I would need a rigid transform block containing a signal input to change the translational offset. I tried to set the offset as a parameter but I couldn’t figure out how to update it during simulation, let’s say using an S-function. Or is there any other trick I could use? Thank you!Hi, is there any way how to change the rigid transform parameters between two frames during simulation in MultiBody Simscape? Ideally, I would need a rigid transform block containing a signal input to change the translational offset. I tried to set the offset as a parameter but I couldn’t figure out how to update it during simulation, let’s say using an S-function. Or is there any other trick I could use? Thank you! Hi, is there any way how to change the rigid transform parameters between two frames during simulation in MultiBody Simscape? Ideally, I would need a rigid transform block containing a signal input to change the translational offset. I tried to set the offset as a parameter but I couldn’t figure out how to update it during simulation, let’s say using an S-function. Or is there any other trick I could use? Thank you! rigid transform, multibody simscape, update transform parameters MATLAB Answers — New Questions
How can I draw NSIDC’s Polar Stereographic Projection use M_Map
When I use the m_map toolkit to draw polar stereographic projections, how do I set up the projection information to get NSIDC’s Polar Stereographic Projection(EPSG:3411)。
This is how I currently have it set up, but it’s not clear if there is a bias:
m_proj(‘azimuthal equal-area’,’latitude’,90,’longitude’,-45,’radius’,45,’rectbox’,’on’);
Can m_map be used in conjunction with PROJ4?
For example using PROJ4:+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defsWhen I use the m_map toolkit to draw polar stereographic projections, how do I set up the projection information to get NSIDC’s Polar Stereographic Projection(EPSG:3411)。
This is how I currently have it set up, but it’s not clear if there is a bias:
m_proj(‘azimuthal equal-area’,’latitude’,90,’longitude’,-45,’radius’,45,’rectbox’,’on’);
Can m_map be used in conjunction with PROJ4?
For example using PROJ4:+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs When I use the m_map toolkit to draw polar stereographic projections, how do I set up the projection information to get NSIDC’s Polar Stereographic Projection(EPSG:3411)。
This is how I currently have it set up, but it’s not clear if there is a bias:
m_proj(‘azimuthal equal-area’,’latitude’,90,’longitude’,-45,’radius’,45,’rectbox’,’on’);
Can m_map be used in conjunction with PROJ4?
For example using PROJ4:+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs m_map, nsidc’s polar stereographic projection, proj4 MATLAB Answers — New Questions
HOW TO Get Roadrunner license?
I follow the instruction of https://ww2.mathworks.cn/matlabcentral/answers/533728-roadrunner to find the license of Roadrunner, but there is only MATLAB in my license list.
Then I tried to get a trial in https://ww2.mathworks.cn/products/roadrunner.html , but after 48 hours, nobody contacted me through my email.
I want to know how to get the license of Roadrunner and its installation, please.I follow the instruction of https://ww2.mathworks.cn/matlabcentral/answers/533728-roadrunner to find the license of Roadrunner, but there is only MATLAB in my license list.
Then I tried to get a trial in https://ww2.mathworks.cn/products/roadrunner.html , but after 48 hours, nobody contacted me through my email.
I want to know how to get the license of Roadrunner and its installation, please. I follow the instruction of https://ww2.mathworks.cn/matlabcentral/answers/533728-roadrunner to find the license of Roadrunner, but there is only MATLAB in my license list.
Then I tried to get a trial in https://ww2.mathworks.cn/products/roadrunner.html , but after 48 hours, nobody contacted me through my email.
I want to know how to get the license of Roadrunner and its installation, please. roadrunner, license MATLAB Answers — New Questions
What is the multiplier in the “tank” section of the Reverberator system object
Hi there, I’m looking into the Reverberator system object to see how we can use it to produce a controlled IR with a known RT per frequency.
In the Algorithm section of the Mathworks help on the object, there is a "tank" sub-section. We would like to know why the output signal is multiplied by 0.6? There’s no reasoning behind this in the documentation, perhaps it is obvious, but I don’t want to make assumptions.
If someone could explain this multiplication factor that would be most helpful.
Many thanks.Hi there, I’m looking into the Reverberator system object to see how we can use it to produce a controlled IR with a known RT per frequency.
In the Algorithm section of the Mathworks help on the object, there is a "tank" sub-section. We would like to know why the output signal is multiplied by 0.6? There’s no reasoning behind this in the documentation, perhaps it is obvious, but I don’t want to make assumptions.
If someone could explain this multiplication factor that would be most helpful.
Many thanks. Hi there, I’m looking into the Reverberator system object to see how we can use it to produce a controlled IR with a known RT per frequency.
In the Algorithm section of the Mathworks help on the object, there is a "tank" sub-section. We would like to know why the output signal is multiplied by 0.6? There’s no reasoning behind this in the documentation, perhaps it is obvious, but I don’t want to make assumptions.
If someone could explain this multiplication factor that would be most helpful.
Many thanks. reverberator, signal processing, audio toolbox MATLAB Answers — New Questions
All pins reserved by servo. I cant use a DC motor at the same time.
Hi everyone, I have just started to use MATLAB with arduino for a university project.
I’m trying to use both a servo and a DC motor with an arduino, but when I initialise the servo motor, all the pins (or at least the PWM ones) become reserved to the servo.
a = arduino(‘COM4’, ‘Uno’, ‘Libraries’, ‘Servo’)
s = servo(a, ‘D11’, ‘MinPulseDuration’, 0.00055, ‘MaxPulseDuration’, 0.0024)
writePWMDutyCycle(a, "D9", 1)
The error I get is:
"Digital pin D9 is reserved by Servo in ‘Reserved’ mode. To change the pin configuration, clear all variables holding onto this resource."
I have tried other pins, but they are all reserved. If i don’t initialise the servo, it works.
How can I reserve just one pin for the servo and not all of them?
ThanksHi everyone, I have just started to use MATLAB with arduino for a university project.
I’m trying to use both a servo and a DC motor with an arduino, but when I initialise the servo motor, all the pins (or at least the PWM ones) become reserved to the servo.
a = arduino(‘COM4’, ‘Uno’, ‘Libraries’, ‘Servo’)
s = servo(a, ‘D11’, ‘MinPulseDuration’, 0.00055, ‘MaxPulseDuration’, 0.0024)
writePWMDutyCycle(a, "D9", 1)
The error I get is:
"Digital pin D9 is reserved by Servo in ‘Reserved’ mode. To change the pin configuration, clear all variables holding onto this resource."
I have tried other pins, but they are all reserved. If i don’t initialise the servo, it works.
How can I reserve just one pin for the servo and not all of them?
Thanks Hi everyone, I have just started to use MATLAB with arduino for a university project.
I’m trying to use both a servo and a DC motor with an arduino, but when I initialise the servo motor, all the pins (or at least the PWM ones) become reserved to the servo.
a = arduino(‘COM4’, ‘Uno’, ‘Libraries’, ‘Servo’)
s = servo(a, ‘D11’, ‘MinPulseDuration’, 0.00055, ‘MaxPulseDuration’, 0.0024)
writePWMDutyCycle(a, "D9", 1)
The error I get is:
"Digital pin D9 is reserved by Servo in ‘Reserved’ mode. To change the pin configuration, clear all variables holding onto this resource."
I have tried other pins, but they are all reserved. If i don’t initialise the servo, it works.
How can I reserve just one pin for the servo and not all of them?
Thanks arduino, servomotor, dc, dc motor, servo, servo motor, pwm pins, power_electronics_control, electric_motor_control, power_conversion_control MATLAB Answers — New Questions
How can I save a 32 bit image (uint32) as a tiff?
Hello,
I am currently working on a post processing HDR script which requires that I use a 32 bit data type. The images start at 14 bit, once they are imported I convert them to int32, and after I do my calculations I convert them back to uint32. After I create my HDR image the max pixel value is about 181,000 counts. I am currently using,
imwrite(FinalImage, ‘HDR Result.tif’)
which works for 16 bit images, but does not seem to work for 32 bit images. If you could give me any help or insight I would greatly appreciate it.
Thank you,
JasonHello,
I am currently working on a post processing HDR script which requires that I use a 32 bit data type. The images start at 14 bit, once they are imported I convert them to int32, and after I do my calculations I convert them back to uint32. After I create my HDR image the max pixel value is about 181,000 counts. I am currently using,
imwrite(FinalImage, ‘HDR Result.tif’)
which works for 16 bit images, but does not seem to work for 32 bit images. If you could give me any help or insight I would greatly appreciate it.
Thank you,
Jason Hello,
I am currently working on a post processing HDR script which requires that I use a 32 bit data type. The images start at 14 bit, once they are imported I convert them to int32, and after I do my calculations I convert them back to uint32. After I create my HDR image the max pixel value is about 181,000 counts. I am currently using,
imwrite(FinalImage, ‘HDR Result.tif’)
which works for 16 bit images, but does not seem to work for 32 bit images. If you could give me any help or insight I would greatly appreciate it.
Thank you,
Jason hdr, imwrite, tiff MATLAB Answers — New Questions
Is there an option to avoid generating translations in the generated code from a Simulink Model that is created by importing an arxml with Interfaces Mapped to COMPU METTHODS?
I have generated a simulink model from an arxml , that has the interfaces associated with Application Data types and Compu methods.
Added the following logic shown here. Is there a way to avoid the translation that is generated in the code.I have generated a simulink model from an arxml , that has the interfaces associated with Application Data types and Compu methods.
Added the following logic shown here. Is there a way to avoid the translation that is generated in the code. I have generated a simulink model from an arxml , that has the interfaces associated with Application Data types and Compu methods.
Added the following logic shown here. Is there a way to avoid the translation that is generated in the code. autosar compu methods MATLAB Answers — New Questions
matlab code for spectrum sensing in cognitive radio
i am doing my thesis on cognitive radios.so ,i need matlab code for spectrum sensingi am doing my thesis on cognitive radios.so ,i need matlab code for spectrum sensing i am doing my thesis on cognitive radios.so ,i need matlab code for spectrum sensing cognitive radio, spectrum sensing MATLAB Answers — New Questions
Normalizing by means of zero-mean
Hello friends,
I am working on retinal images and need to make them standard before processing, because some images are dark others are very light. So before processing I am doing the following:
gemiddeld=mean2(DOG)
standaard_afwyking=std2(DOG)
NormalizedArray = (DOG-gemiddeld) ./ standaard_afwyking;
NormalizedArray =((NormalizedArray + 3)./ 6).*255
figure,imshow(NormalizedArray);
This is not working, because the output is just a blank white image.How can I fix this?Hello friends,
I am working on retinal images and need to make them standard before processing, because some images are dark others are very light. So before processing I am doing the following:
gemiddeld=mean2(DOG)
standaard_afwyking=std2(DOG)
NormalizedArray = (DOG-gemiddeld) ./ standaard_afwyking;
NormalizedArray =((NormalizedArray + 3)./ 6).*255
figure,imshow(NormalizedArray);
This is not working, because the output is just a blank white image.How can I fix this? Hello friends,
I am working on retinal images and need to make them standard before processing, because some images are dark others are very light. So before processing I am doing the following:
gemiddeld=mean2(DOG)
standaard_afwyking=std2(DOG)
NormalizedArray = (DOG-gemiddeld) ./ standaard_afwyking;
NormalizedArray =((NormalizedArray + 3)./ 6).*255
figure,imshow(NormalizedArray);
This is not working, because the output is just a blank white image.How can I fix this? zero-mean on images MATLAB Answers — New Questions
Best Text/number location on the plot
Hello,
I want to generate the values of x on each subplot and i was wondering if there is a way to get the text or numbers placed in ‘best’ location than specifying (x,y) coordinates for the text location.
x(1) on plot 1
x(2) on plot 2 etc inside a forloop
thank you
danHello,
I want to generate the values of x on each subplot and i was wondering if there is a way to get the text or numbers placed in ‘best’ location than specifying (x,y) coordinates for the text location.
x(1) on plot 1
x(2) on plot 2 etc inside a forloop
thank you
dan Hello,
I want to generate the values of x on each subplot and i was wondering if there is a way to get the text or numbers placed in ‘best’ location than specifying (x,y) coordinates for the text location.
x(1) on plot 1
x(2) on plot 2 etc inside a forloop
thank you
dan add text, forloop MATLAB Answers — New Questions
fill area between two polar curves
Hello , i have these two formulas, i would like to fill the area between these two curves
is there a way to do it with patch command?
Thanks
<</matlabcentral/answers/uploaded_files/70181/Capture.JPG>>
phi=0.87*sin((log(r)*pi)/(log(tau)));
phi_shifted_45=0.87*sin((log(r)*pi)/(log(tau)))+0.78;Hello , i have these two formulas, i would like to fill the area between these two curves
is there a way to do it with patch command?
Thanks
<</matlabcentral/answers/uploaded_files/70181/Capture.JPG>>
phi=0.87*sin((log(r)*pi)/(log(tau)));
phi_shifted_45=0.87*sin((log(r)*pi)/(log(tau)))+0.78; Hello , i have these two formulas, i would like to fill the area between these two curves
is there a way to do it with patch command?
Thanks
<</matlabcentral/answers/uploaded_files/70181/Capture.JPG>>
phi=0.87*sin((log(r)*pi)/(log(tau)));
phi_shifted_45=0.87*sin((log(r)*pi)/(log(tau)))+0.78; patch between polar curves MATLAB Answers — New Questions
Why did all my online course progress disappear?
Why did all my online course progress disappear?Why did all my online course progress disappear? Why did all my online course progress disappear? onramp, self, paced, online, courses, lost, progress MATLAB Answers — New Questions
rotate3d off not working
I have an application that uses _pcshow()_ to plot a point cloud. It seems to activate _rotate3d_ which I have to turn off by all means because I need the mouse cursor to trigger click events of graphical objects. When using _rotate3d off_ after _pcshow()_ Matlab prints the following error messages:
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Error in vision.internal.pc.initializePCSceneControl>localRotateStopMode (line 79)
btn.State = ‘off’;
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in matlab.uitools.internal.uimode/modeControl (line 22)
hgfeval(hThis.ModeStopFcn);
Error in matlab.uitools.internal.uimode/set.Enable (line 173)
obj.Enable = modeControl(obj,value);
Error in matlab.uitools.internal.uimodemanager>localSetMode (line 173)
set(currMode,’Enable’,’off’);
Error in matlab.uitools.internal.uimodemanager/set.CurrentMode (line 111)
obj.CurrentMode = localSetMode(obj,value);
Error in activateuimode (line 20)
set(hManager,’CurrentMode’,hMode);
Error in rotate3d>setState (line 319)
activateuimode(fig,”);
Error in rotate3d (line 202)
setState(hTarget,arg,getStyle(hFig));
Error in TransformApp/onAddImgClick (line 214)
rotate3d off
Error in TransformApp>@(varargin)obj.onAddImgClick(varargin{:}) (line 52)
‘Callback’, @obj.onAddImgClick);
Error using uiwait (line 81)
Error while evaluating UIControl Callback.
>>
Note that the application uses _uiwait()_ and _uiresume()_ to block the execution of the script that launches my application. I also tried _h = rotate3d(); h.Enable = ‘off’;_ but it produces the same error.I have an application that uses _pcshow()_ to plot a point cloud. It seems to activate _rotate3d_ which I have to turn off by all means because I need the mouse cursor to trigger click events of graphical objects. When using _rotate3d off_ after _pcshow()_ Matlab prints the following error messages:
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Error in vision.internal.pc.initializePCSceneControl>localRotateStopMode (line 79)
btn.State = ‘off’;
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in matlab.uitools.internal.uimode/modeControl (line 22)
hgfeval(hThis.ModeStopFcn);
Error in matlab.uitools.internal.uimode/set.Enable (line 173)
obj.Enable = modeControl(obj,value);
Error in matlab.uitools.internal.uimodemanager>localSetMode (line 173)
set(currMode,’Enable’,’off’);
Error in matlab.uitools.internal.uimodemanager/set.CurrentMode (line 111)
obj.CurrentMode = localSetMode(obj,value);
Error in activateuimode (line 20)
set(hManager,’CurrentMode’,hMode);
Error in rotate3d>setState (line 319)
activateuimode(fig,”);
Error in rotate3d (line 202)
setState(hTarget,arg,getStyle(hFig));
Error in TransformApp/onAddImgClick (line 214)
rotate3d off
Error in TransformApp>@(varargin)obj.onAddImgClick(varargin{:}) (line 52)
‘Callback’, @obj.onAddImgClick);
Error using uiwait (line 81)
Error while evaluating UIControl Callback.
>>
Note that the application uses _uiwait()_ and _uiresume()_ to block the execution of the script that launches my application. I also tried _h = rotate3d(); h.Enable = ‘off’;_ but it produces the same error. I have an application that uses _pcshow()_ to plot a point cloud. It seems to activate _rotate3d_ which I have to turn off by all means because I need the mouse cursor to trigger click events of graphical objects. When using _rotate3d off_ after _pcshow()_ Matlab prints the following error messages:
Property assignment is not allowed when the object is empty. Use subscripted assignment to create an array element.
Error in vision.internal.pc.initializePCSceneControl>localRotateStopMode (line 79)
btn.State = ‘off’;
Error in hgfeval (line 62)
feval(fcn{1},varargin{:},fcn{2:end});
Error in matlab.uitools.internal.uimode/modeControl (line 22)
hgfeval(hThis.ModeStopFcn);
Error in matlab.uitools.internal.uimode/set.Enable (line 173)
obj.Enable = modeControl(obj,value);
Error in matlab.uitools.internal.uimodemanager>localSetMode (line 173)
set(currMode,’Enable’,’off’);
Error in matlab.uitools.internal.uimodemanager/set.CurrentMode (line 111)
obj.CurrentMode = localSetMode(obj,value);
Error in activateuimode (line 20)
set(hManager,’CurrentMode’,hMode);
Error in rotate3d>setState (line 319)
activateuimode(fig,”);
Error in rotate3d (line 202)
setState(hTarget,arg,getStyle(hFig));
Error in TransformApp/onAddImgClick (line 214)
rotate3d off
Error in TransformApp>@(varargin)obj.onAddImgClick(varargin{:}) (line 52)
‘Callback’, @obj.onAddImgClick);
Error using uiwait (line 81)
Error while evaluating UIControl Callback.
>>
Note that the application uses _uiwait()_ and _uiresume()_ to block the execution of the script that launches my application. I also tried _h = rotate3d(); h.Enable = ‘off’;_ but it produces the same error. rotate3d MATLAB Answers — New Questions
rotate3d not working properly with matlab GUI and pcshow function
Hey!
I’m trying to create a GUI to visualize and postprocess some data (ASCII pointcloud). Unfortunately the rotate3d function does not work the intended way when dealing with GUI elements and pcshow. There seems to be an issue with the button up callback. On one hand, the rotation of the axis is somehow buggy (everytime I klick again, it jumps to another view) and on the other hand, the cursor does not change when leaving the axis.
I tried this on several machines. It occours on r2017b and r2016b. On r2015b, the rotation works perfect, but the cursor still does not change.
plot3 and scatter3 are working fine but are not suitable for my application.
I added two files with an mwe to help spotting the issue.
Thank you for your help.Hey!
I’m trying to create a GUI to visualize and postprocess some data (ASCII pointcloud). Unfortunately the rotate3d function does not work the intended way when dealing with GUI elements and pcshow. There seems to be an issue with the button up callback. On one hand, the rotation of the axis is somehow buggy (everytime I klick again, it jumps to another view) and on the other hand, the cursor does not change when leaving the axis.
I tried this on several machines. It occours on r2017b and r2016b. On r2015b, the rotation works perfect, but the cursor still does not change.
plot3 and scatter3 are working fine but are not suitable for my application.
I added two files with an mwe to help spotting the issue.
Thank you for your help. Hey!
I’m trying to create a GUI to visualize and postprocess some data (ASCII pointcloud). Unfortunately the rotate3d function does not work the intended way when dealing with GUI elements and pcshow. There seems to be an issue with the button up callback. On one hand, the rotation of the axis is somehow buggy (everytime I klick again, it jumps to another view) and on the other hand, the cursor does not change when leaving the axis.
I tried this on several machines. It occours on r2017b and r2016b. On r2015b, the rotation works perfect, but the cursor still does not change.
plot3 and scatter3 are working fine but are not suitable for my application.
I added two files with an mwe to help spotting the issue.
Thank you for your help. rotate3d, pcshow, gui, problem MATLAB Answers — New Questions