Category: Matlab
Category Archives: Matlab
How to give MATLAB Web App Server access to a directory or a file on the server?
I have a web app that interacts with a local directory on the server machine. How do I give the Web App Server access to the directory?I have a web app that interacts with a local directory on the server machine. How do I give the Web App Server access to the directory? I have a web app that interacts with a local directory on the server machine. How do I give the Web App Server access to the directory? server, file, webapp MATLAB Answers — New Questions
Arduino MKR Motor Carrier Not Found
I’m trying to use the Arduino MKR 1000 with Motor Carrier and when I run
arduinosetup
and follow the prompts to set up my board, I get the following error log
Jun 03, 2023 12:02:42 PM com.mathworks.hwservices.logging
INFO: Loading configuration…
Initializing packages…
Preparing boards…
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Verifying…
C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1arduino-builder -dump-prefs -logger=machine -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardware -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1tools-builder -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardwaretoolsavr -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -built-in-libraries C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1libraries -libraries C:UsersmasteDocumentsArduinolibraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:UsersmasteAppDataLocalTempArduinoServerMW -warnings=null -prefs=build.path=C:UsersmasteAppDataLocalTempArduinoServerMW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.openocd.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsopenocd.9.0-arduino6-static -prefs=runtime.tools.arduinoOTA.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarduinoOTA1.2.0 -prefs=runtime.tools.CMSIS-Atmel.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0 -prefs=runtime.tools.bossac.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsbossac1.7.0 -prefs=runtime.tools.CMSIS.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1 -verbose C:UsersmasteAppDataLocalTempArduinoServerArduinoServer.ino
C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1arduino-builder -compile -logger=machine -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardware -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1tools-builder -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardwaretoolsavr -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -built-in-libraries C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1libraries -libraries C:UsersmasteDocumentsArduinolibraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:UsersmasteAppDataLocalTempArduinoServerMW -warnings=null -prefs=build.path=C:UsersmasteAppDataLocalTempArduinoServerMW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.openocd.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsopenocd.9.0-arduino6-static -prefs=runtime.tools.arduinoOTA.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarduinoOTA1.2.0 -prefs=runtime.tools.CMSIS-Atmel.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0 -prefs=runtime.tools.bossac.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsbossac1.7.0 -prefs=runtime.tools.CMSIS.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1 -verbose C:UsersmasteAppDataLocalTempArduinoServerArduinoServer.ino
Using board ‘mkr1000’ from platform in folder: C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20
Using core ‘arduino’ from platform in folder: C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20
Detecting libraries used…
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchArduinoServer.ino.cpp" -o "nul"
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp" -o "nul"
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp" -o "C:UsersmasteAppDataLocalTempArduinoServerMWpreprocctags_target_for_gcc_minus_e.cpp"
In file included from C:UsersmasteAppDataLocalTempArduinoServerMWsketchaddOnLibraries.h:4:0,
from C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp:12:
C:UsersmasteAppDataRoamingMathWorksMATLAB Add-OnsToolboxesAEK-Rev-1-Hardware-Support-19a+matlabMATLABAddon+arduinoioaddons+arduinosrcMKRMotorCarrierBase.h:11:29: fatal error: MKRMotorCarrier.h: No such file or directory
#include "MKRMotorCarrier.h"
^
compilation terminated.
exit status 1
I have already ran
edit ArduinoKitHardwareSupportReadMe.txt
and followed the directions. I can confirm that the correct Motor Carrier library is in place.
What could I need to do? Do I need to move MKRMotorCarrier.h somewhere?I’m trying to use the Arduino MKR 1000 with Motor Carrier and when I run
arduinosetup
and follow the prompts to set up my board, I get the following error log
Jun 03, 2023 12:02:42 PM com.mathworks.hwservices.logging
INFO: Loading configuration…
Initializing packages…
Preparing boards…
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Verifying…
C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1arduino-builder -dump-prefs -logger=machine -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardware -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1tools-builder -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardwaretoolsavr -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -built-in-libraries C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1libraries -libraries C:UsersmasteDocumentsArduinolibraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:UsersmasteAppDataLocalTempArduinoServerMW -warnings=null -prefs=build.path=C:UsersmasteAppDataLocalTempArduinoServerMW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.openocd.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsopenocd.9.0-arduino6-static -prefs=runtime.tools.arduinoOTA.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarduinoOTA1.2.0 -prefs=runtime.tools.CMSIS-Atmel.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0 -prefs=runtime.tools.bossac.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsbossac1.7.0 -prefs=runtime.tools.CMSIS.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1 -verbose C:UsersmasteAppDataLocalTempArduinoServerArduinoServer.ino
C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1arduino-builder -compile -logger=machine -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardware -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1tools-builder -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardwaretoolsavr -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -built-in-libraries C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1libraries -libraries C:UsersmasteDocumentsArduinolibraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:UsersmasteAppDataLocalTempArduinoServerMW -warnings=null -prefs=build.path=C:UsersmasteAppDataLocalTempArduinoServerMW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.openocd.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsopenocd.9.0-arduino6-static -prefs=runtime.tools.arduinoOTA.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarduinoOTA1.2.0 -prefs=runtime.tools.CMSIS-Atmel.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0 -prefs=runtime.tools.bossac.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsbossac1.7.0 -prefs=runtime.tools.CMSIS.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1 -verbose C:UsersmasteAppDataLocalTempArduinoServerArduinoServer.ino
Using board ‘mkr1000’ from platform in folder: C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20
Using core ‘arduino’ from platform in folder: C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20
Detecting libraries used…
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchArduinoServer.ino.cpp" -o "nul"
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp" -o "nul"
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp" -o "C:UsersmasteAppDataLocalTempArduinoServerMWpreprocctags_target_for_gcc_minus_e.cpp"
In file included from C:UsersmasteAppDataLocalTempArduinoServerMWsketchaddOnLibraries.h:4:0,
from C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp:12:
C:UsersmasteAppDataRoamingMathWorksMATLAB Add-OnsToolboxesAEK-Rev-1-Hardware-Support-19a+matlabMATLABAddon+arduinoioaddons+arduinosrcMKRMotorCarrierBase.h:11:29: fatal error: MKRMotorCarrier.h: No such file or directory
#include "MKRMotorCarrier.h"
^
compilation terminated.
exit status 1
I have already ran
edit ArduinoKitHardwareSupportReadMe.txt
and followed the directions. I can confirm that the correct Motor Carrier library is in place.
What could I need to do? Do I need to move MKRMotorCarrier.h somewhere? I’m trying to use the Arduino MKR 1000 with Motor Carrier and when I run
arduinosetup
and follow the prompts to set up my board, I get the following error log
Jun 03, 2023 12:02:42 PM com.mathworks.hwservices.logging
INFO: Loading configuration…
Initializing packages…
Preparing boards…
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Invalid library found in C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1: C:UsersmasteDocumentsArduinolibrariesMKRMotorCarrier-1.0.1
Verifying…
C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1arduino-builder -dump-prefs -logger=machine -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardware -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1tools-builder -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardwaretoolsavr -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -built-in-libraries C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1libraries -libraries C:UsersmasteDocumentsArduinolibraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:UsersmasteAppDataLocalTempArduinoServerMW -warnings=null -prefs=build.path=C:UsersmasteAppDataLocalTempArduinoServerMW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.openocd.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsopenocd.9.0-arduino6-static -prefs=runtime.tools.arduinoOTA.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarduinoOTA1.2.0 -prefs=runtime.tools.CMSIS-Atmel.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0 -prefs=runtime.tools.bossac.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsbossac1.7.0 -prefs=runtime.tools.CMSIS.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1 -verbose C:UsersmasteAppDataLocalTempArduinoServerArduinoServer.ino
C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1arduino-builder -compile -logger=machine -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardware -hardware C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1tools-builder -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1hardwaretoolsavr -tools C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackages -built-in-libraries C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetarduino-1.8.1libraries -libraries C:UsersmasteDocumentsArduinolibraries -fqbn=arduino:samd:mkr1000 -vid-pid=0X2341_0X804E -ide-version=10801 -build-path C:UsersmasteAppDataLocalTempArduinoServerMW -warnings=null -prefs=build.path=C:UsersmasteAppDataLocalTempArduinoServerMW -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.openocd.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsopenocd.9.0-arduino6-static -prefs=runtime.tools.arduinoOTA.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarduinoOTA1.2.0 -prefs=runtime.tools.CMSIS-Atmel.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0 -prefs=runtime.tools.bossac.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsbossac1.7.0 -prefs=runtime.tools.CMSIS.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1 -verbose C:UsersmasteAppDataLocalTempArduinoServerArduinoServer.ino
Using board ‘mkr1000’ from platform in folder: C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20
Using core ‘arduino’ from platform in folder: C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20
Detecting libraries used…
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchArduinoServer.ino.cpp" -o "nul"
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp" -o "nul"
"C:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsarm-none-eabi-gcc4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib –param max-inline-insns-single=500 -fno-rtti -fno-exceptions -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10801 -DARDUINO_SAMD_MKR1000 -DARDUINO_ARCH_SAMD -DUSE_ARDUINO_MKR_PIN_LAYOUT -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804e -DUSBCON ‘-DUSB_MANUFACTURER="Arduino LLC"’ ‘-DUSB_PRODUCT="Arduino MKR1000"’ "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS4.5.0/CMSIS/Include/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinotoolsCMSIS-Atmel1.1.0/CMSIS/Device/ATMEL/" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20coresarduino" "-IC:ProgramDataMATLABSupportPackagesR2019a3P.instrsetarduinoide.instrsetidepkgspackagesarduinohardwaresamd1.6.20variantsmkr1000" "C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp" -o "C:UsersmasteAppDataLocalTempArduinoServerMWpreprocctags_target_for_gcc_minus_e.cpp"
In file included from C:UsersmasteAppDataLocalTempArduinoServerMWsketchaddOnLibraries.h:4:0,
from C:UsersmasteAppDataLocalTempArduinoServerMWsketchIO_addOn.cpp:12:
C:UsersmasteAppDataRoamingMathWorksMATLAB Add-OnsToolboxesAEK-Rev-1-Hardware-Support-19a+matlabMATLABAddon+arduinoioaddons+arduinosrcMKRMotorCarrierBase.h:11:29: fatal error: MKRMotorCarrier.h: No such file or directory
#include "MKRMotorCarrier.h"
^
compilation terminated.
exit status 1
I have already ran
edit ArduinoKitHardwareSupportReadMe.txt
and followed the directions. I can confirm that the correct Motor Carrier library is in place.
What could I need to do? Do I need to move MKRMotorCarrier.h somewhere? arduino MATLAB Answers — New Questions
How to detect change in mean value of a signal
Hello!!!
I would like to ask for some help.
I am working with inputing a large number of time-series signals. Among these signals, there are some signals which the mean value has changed. I would ignore reading the signals which there is a change in mean value. I will give three examples of signal: 1) normal (without changing mean), 2) abrupt changing in mean value, and 3) linear changing in mean value. My goal is to detect signals which there is a change in mean and skip reading these signals.
Ps., I would like to set criteria that if the magnitude of change in mean is larger than 10,000, it will treat as there is a change of mean value. Lastly, the files of these three examples of signal are also attached.
1) Normal (✅ would like to input to matlab)
2) Abupt change (❌ do not want to input to matlab)
3) Linear change (❌ do not want to input to matlab)Hello!!!
I would like to ask for some help.
I am working with inputing a large number of time-series signals. Among these signals, there are some signals which the mean value has changed. I would ignore reading the signals which there is a change in mean value. I will give three examples of signal: 1) normal (without changing mean), 2) abrupt changing in mean value, and 3) linear changing in mean value. My goal is to detect signals which there is a change in mean and skip reading these signals.
Ps., I would like to set criteria that if the magnitude of change in mean is larger than 10,000, it will treat as there is a change of mean value. Lastly, the files of these three examples of signal are also attached.
1) Normal (✅ would like to input to matlab)
2) Abupt change (❌ do not want to input to matlab)
3) Linear change (❌ do not want to input to matlab) Hello!!!
I would like to ask for some help.
I am working with inputing a large number of time-series signals. Among these signals, there are some signals which the mean value has changed. I would ignore reading the signals which there is a change in mean value. I will give three examples of signal: 1) normal (without changing mean), 2) abrupt changing in mean value, and 3) linear changing in mean value. My goal is to detect signals which there is a change in mean and skip reading these signals.
Ps., I would like to set criteria that if the magnitude of change in mean is larger than 10,000, it will treat as there is a change of mean value. Lastly, the files of these three examples of signal are also attached.
1) Normal (✅ would like to input to matlab)
2) Abupt change (❌ do not want to input to matlab)
3) Linear change (❌ do not want to input to matlab) matlab, signal processing MATLAB Answers — New Questions
Simulink Mask won’t display parameter values
I want my masked subsystem to display two parameter values, but for some reason it is only displaying the variable name. I am not sure what the problem is. Photos are attached.I want my masked subsystem to display two parameter values, but for some reason it is only displaying the variable name. I am not sure what the problem is. Photos are attached. I want my masked subsystem to display two parameter values, but for some reason it is only displaying the variable name. I am not sure what the problem is. Photos are attached. simulink, mask, subsystem MATLAB Answers — New Questions
u003cu0068u0031u003eHow to use Thi”ngSpeak””
lsls ls u003cu0068u0031u003e<h1><h1>%3ch1%3ehwkki%22 MATLAB Answers — New Questions
Import color video as grayscale?
Hi,
I am using the image processing toolbox and wonder if there is a smarter way to import color video as grayscale rather than looping over the color frames with the RGB2GRAY function (see below).
colorVidFrames = read(videoObj, [startFrame endFrame]);
for f = startFrame:endFrame
J = rgb2gray(colorVidFrames(:,:,:,f)); % CONVERT COLOR TO GRAY
gFrames(:,f) = J(:); % GRAY FRAMES
end
clear colorVidFrames
While the RGB2GRAY loop method does provide the desired end result, it is quite computationally expensive for my application. I understand that the computational rigor could be alleviated via parallel computing, but I’m really looking to avoid the conversion loop altogether if possible.
Thanks,
-JeffHi,
I am using the image processing toolbox and wonder if there is a smarter way to import color video as grayscale rather than looping over the color frames with the RGB2GRAY function (see below).
colorVidFrames = read(videoObj, [startFrame endFrame]);
for f = startFrame:endFrame
J = rgb2gray(colorVidFrames(:,:,:,f)); % CONVERT COLOR TO GRAY
gFrames(:,f) = J(:); % GRAY FRAMES
end
clear colorVidFrames
While the RGB2GRAY loop method does provide the desired end result, it is quite computationally expensive for my application. I understand that the computational rigor could be alleviated via parallel computing, but I’m really looking to avoid the conversion loop altogether if possible.
Thanks,
-Jeff Hi,
I am using the image processing toolbox and wonder if there is a smarter way to import color video as grayscale rather than looping over the color frames with the RGB2GRAY function (see below).
colorVidFrames = read(videoObj, [startFrame endFrame]);
for f = startFrame:endFrame
J = rgb2gray(colorVidFrames(:,:,:,f)); % CONVERT COLOR TO GRAY
gFrames(:,f) = J(:); % GRAY FRAMES
end
clear colorVidFrames
While the RGB2GRAY loop method does provide the desired end result, it is quite computationally expensive for my application. I understand that the computational rigor could be alleviated via parallel computing, but I’m really looking to avoid the conversion loop altogether if possible.
Thanks,
-Jeff rgb2gray import video read videoreader color grayscale MATLAB Answers — New Questions
Is there a way to crop an array depending on the values that I want through a function as the values change?
I currently have a graph that has multiple flat maxima but I only want the index values of the last one. I am currently using islocalmax(data,’flatselection’,’all’) to get all of the local maxima that exist and that then gives me a logical array which I can then either get the index values of all the 1’s but I then want the last collection of 1’s or the last collection of consecutive indexes. I was just wondering if there was a way to specifically select these values? I could manually find the start point of the last set and then set it to the end but as I want to use it on multiple data sets I want it to be automatic.
peaks = islocalmax(test.CAN_EMTrq,’FlatSelection’,’all’);
peaks1 = find(peaks==1);
This is the code I am using right now.
The table either looks like: 000011111000100001111101111 and I want the last 4 1’s or it looks like: 12,13,14,15,34,35,36,37,38,56,57,58,59 and I want the last 4 numbers.
ThanksI currently have a graph that has multiple flat maxima but I only want the index values of the last one. I am currently using islocalmax(data,’flatselection’,’all’) to get all of the local maxima that exist and that then gives me a logical array which I can then either get the index values of all the 1’s but I then want the last collection of 1’s or the last collection of consecutive indexes. I was just wondering if there was a way to specifically select these values? I could manually find the start point of the last set and then set it to the end but as I want to use it on multiple data sets I want it to be automatic.
peaks = islocalmax(test.CAN_EMTrq,’FlatSelection’,’all’);
peaks1 = find(peaks==1);
This is the code I am using right now.
The table either looks like: 000011111000100001111101111 and I want the last 4 1’s or it looks like: 12,13,14,15,34,35,36,37,38,56,57,58,59 and I want the last 4 numbers.
Thanks I currently have a graph that has multiple flat maxima but I only want the index values of the last one. I am currently using islocalmax(data,’flatselection’,’all’) to get all of the local maxima that exist and that then gives me a logical array which I can then either get the index values of all the 1’s but I then want the last collection of 1’s or the last collection of consecutive indexes. I was just wondering if there was a way to specifically select these values? I could manually find the start point of the last set and then set it to the end but as I want to use it on multiple data sets I want it to be automatic.
peaks = islocalmax(test.CAN_EMTrq,’FlatSelection’,’all’);
peaks1 = find(peaks==1);
This is the code I am using right now.
The table either looks like: 000011111000100001111101111 and I want the last 4 1’s or it looks like: 12,13,14,15,34,35,36,37,38,56,57,58,59 and I want the last 4 numbers.
Thanks matlab, data MATLAB Answers — New Questions
MATLAB wont start on Linux. It did yesterday.
I use MATLAB on Linux every day. It wouldn’t start this morning, reporting a memory problem. I rebooted which didn’t fix anything. I then updated to R2024a (I was on R2023b) and still it wont start. Here’s what I see when I run it from the command line:
$ matlab
MATLAB is selecting SOFTWARE rendering.
library initialization failed – unable to allocate file descriptor table – out of memory
MATLAB is exiting because of fatal error
Killed
$ free -m
total used free shared buff/cache available
Mem: 31531 4149 23394 32 4490 27381
Swap: 975 0 975
$ uname -a
Linux opsproc3 6.6.13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1 (2024-01-20) x86_64 GNU/Linux
Any suggestions as to what the problem might be? I didn’t make any changes to my computer.I use MATLAB on Linux every day. It wouldn’t start this morning, reporting a memory problem. I rebooted which didn’t fix anything. I then updated to R2024a (I was on R2023b) and still it wont start. Here’s what I see when I run it from the command line:
$ matlab
MATLAB is selecting SOFTWARE rendering.
library initialization failed – unable to allocate file descriptor table – out of memory
MATLAB is exiting because of fatal error
Killed
$ free -m
total used free shared buff/cache available
Mem: 31531 4149 23394 32 4490 27381
Swap: 975 0 975
$ uname -a
Linux opsproc3 6.6.13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1 (2024-01-20) x86_64 GNU/Linux
Any suggestions as to what the problem might be? I didn’t make any changes to my computer. I use MATLAB on Linux every day. It wouldn’t start this morning, reporting a memory problem. I rebooted which didn’t fix anything. I then updated to R2024a (I was on R2023b) and still it wont start. Here’s what I see when I run it from the command line:
$ matlab
MATLAB is selecting SOFTWARE rendering.
library initialization failed – unable to allocate file descriptor table – out of memory
MATLAB is exiting because of fatal error
Killed
$ free -m
total used free shared buff/cache available
Mem: 31531 4149 23394 32 4490 27381
Swap: 975 0 975
$ uname -a
Linux opsproc3 6.6.13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.6.13-1 (2024-01-20) x86_64 GNU/Linux
Any suggestions as to what the problem might be? I didn’t make any changes to my computer. linux, memory MATLAB Answers — New Questions
calculate predictions with weights and bias which extracted from LSTM model
Hello,
I’am trying to calculate outputs using parameters from LSTM model (recurrentweight, inputweight, bias)
but output is different between "below codes" and "output from code Y=predict(net,X)".
please help me if you know the problems.
Thank you.
My network structure: (simple network)
layers = [
sequenceInputLayer(9,"Normalization","none") % number of input parameters are 9
lstmLayer(256)
fullyConnectedLayer(1)];
options = trainingOptions("adam", …
MaxEpochs=2000, …
SequencePaddingDirection="left", …
Shuffle="every-epoch", …
Plots="training-progress", …
Verbose=false);
net = trainnet(X,Y,layers,"mse",options);
My code to extract the weights and bias:
R=net.Layers(2,1).RecurrentWeights;
W=net.Layers(2,1).InputWeights;
b=net.Layers(2,1).Bias;
Fc_W=net.Layers(3,1).Weights;
Fc_B=net.Layers(3,1).Bias;
Code for extract parameters of LSTM Layer (input, forget, cell, output)
HiddenLayersNum = 256;
W.Wi=W(1:HiddenLayersNum,:);
W.Wf=W(HiddenLayersNum+1:2*HiddenLayersNum,:);
W.Wc=W(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
W.Wo=W(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
R.Ri=R(1:HiddenLayersNum,:);
R.Rf=R(HiddenLayersNum+1:2*HiddenLayersNum,:);
R.Rc=R(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
R.Ro=R(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
B.bi=b(1,:);
B.bf=b(HiddenLayersNum+1:2*HiddenLayersNum,:);
B.bc=b(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
B.bo=b(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
h=net.State.Value{1,1}; % Hiddenstate
c=net.State.Value{2,1}; % Cellstate
Code for calculate LSTM Layer output:
% Input Gate
Z = W.Wi*X+R.Ri*h+B.bi; % x is new intput value for prediction (ex: x=[1 5 20 1 2];)
I = 1.0 ./ (1.0 + exp(-Z)); % Input gate
% Forget Gate
f =W.Wf*X+R.Rf*h+B.bf;
F = 1.0 ./ (1.0 + exp(-f)); % Forget gate
% Layer Input
g=W.Wc*X+R.Rc*h+B.bc; % Layer input
G=tanh(g);
% Output Layer
output = W.Wo*X+R.Ro*h_prev+B.bo;
output = 1.0 ./ (1.0 + exp(-output)); % Output Gate
% Cell State
cellgate=F.*c+I.*G; % Cell Gate
cellgate=cellgate;
% Output (Hidden) State
hidden=O.*tanh(cellgate); % Output State
hidden=dlarray(hidden);
L1 = relu(hidden);
Code for calculate output in fullyconnected Layer:
Fc=Fc_W*L1+Fc_BHello,
I’am trying to calculate outputs using parameters from LSTM model (recurrentweight, inputweight, bias)
but output is different between "below codes" and "output from code Y=predict(net,X)".
please help me if you know the problems.
Thank you.
My network structure: (simple network)
layers = [
sequenceInputLayer(9,"Normalization","none") % number of input parameters are 9
lstmLayer(256)
fullyConnectedLayer(1)];
options = trainingOptions("adam", …
MaxEpochs=2000, …
SequencePaddingDirection="left", …
Shuffle="every-epoch", …
Plots="training-progress", …
Verbose=false);
net = trainnet(X,Y,layers,"mse",options);
My code to extract the weights and bias:
R=net.Layers(2,1).RecurrentWeights;
W=net.Layers(2,1).InputWeights;
b=net.Layers(2,1).Bias;
Fc_W=net.Layers(3,1).Weights;
Fc_B=net.Layers(3,1).Bias;
Code for extract parameters of LSTM Layer (input, forget, cell, output)
HiddenLayersNum = 256;
W.Wi=W(1:HiddenLayersNum,:);
W.Wf=W(HiddenLayersNum+1:2*HiddenLayersNum,:);
W.Wc=W(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
W.Wo=W(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
R.Ri=R(1:HiddenLayersNum,:);
R.Rf=R(HiddenLayersNum+1:2*HiddenLayersNum,:);
R.Rc=R(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
R.Ro=R(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
B.bi=b(1,:);
B.bf=b(HiddenLayersNum+1:2*HiddenLayersNum,:);
B.bc=b(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
B.bo=b(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
h=net.State.Value{1,1}; % Hiddenstate
c=net.State.Value{2,1}; % Cellstate
Code for calculate LSTM Layer output:
% Input Gate
Z = W.Wi*X+R.Ri*h+B.bi; % x is new intput value for prediction (ex: x=[1 5 20 1 2];)
I = 1.0 ./ (1.0 + exp(-Z)); % Input gate
% Forget Gate
f =W.Wf*X+R.Rf*h+B.bf;
F = 1.0 ./ (1.0 + exp(-f)); % Forget gate
% Layer Input
g=W.Wc*X+R.Rc*h+B.bc; % Layer input
G=tanh(g);
% Output Layer
output = W.Wo*X+R.Ro*h_prev+B.bo;
output = 1.0 ./ (1.0 + exp(-output)); % Output Gate
% Cell State
cellgate=F.*c+I.*G; % Cell Gate
cellgate=cellgate;
% Output (Hidden) State
hidden=O.*tanh(cellgate); % Output State
hidden=dlarray(hidden);
L1 = relu(hidden);
Code for calculate output in fullyconnected Layer:
Fc=Fc_W*L1+Fc_B Hello,
I’am trying to calculate outputs using parameters from LSTM model (recurrentweight, inputweight, bias)
but output is different between "below codes" and "output from code Y=predict(net,X)".
please help me if you know the problems.
Thank you.
My network structure: (simple network)
layers = [
sequenceInputLayer(9,"Normalization","none") % number of input parameters are 9
lstmLayer(256)
fullyConnectedLayer(1)];
options = trainingOptions("adam", …
MaxEpochs=2000, …
SequencePaddingDirection="left", …
Shuffle="every-epoch", …
Plots="training-progress", …
Verbose=false);
net = trainnet(X,Y,layers,"mse",options);
My code to extract the weights and bias:
R=net.Layers(2,1).RecurrentWeights;
W=net.Layers(2,1).InputWeights;
b=net.Layers(2,1).Bias;
Fc_W=net.Layers(3,1).Weights;
Fc_B=net.Layers(3,1).Bias;
Code for extract parameters of LSTM Layer (input, forget, cell, output)
HiddenLayersNum = 256;
W.Wi=W(1:HiddenLayersNum,:);
W.Wf=W(HiddenLayersNum+1:2*HiddenLayersNum,:);
W.Wc=W(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
W.Wo=W(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
R.Ri=R(1:HiddenLayersNum,:);
R.Rf=R(HiddenLayersNum+1:2*HiddenLayersNum,:);
R.Rc=R(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
R.Ro=R(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
B.bi=b(1,:);
B.bf=b(HiddenLayersNum+1:2*HiddenLayersNum,:);
B.bc=b(2*HiddenLayersNum+1:3*HiddenLayersNum,:);
B.bo=b(3*HiddenLayersNum+1:4*HiddenLayersNum,:);
h=net.State.Value{1,1}; % Hiddenstate
c=net.State.Value{2,1}; % Cellstate
Code for calculate LSTM Layer output:
% Input Gate
Z = W.Wi*X+R.Ri*h+B.bi; % x is new intput value for prediction (ex: x=[1 5 20 1 2];)
I = 1.0 ./ (1.0 + exp(-Z)); % Input gate
% Forget Gate
f =W.Wf*X+R.Rf*h+B.bf;
F = 1.0 ./ (1.0 + exp(-f)); % Forget gate
% Layer Input
g=W.Wc*X+R.Rc*h+B.bc; % Layer input
G=tanh(g);
% Output Layer
output = W.Wo*X+R.Ro*h_prev+B.bo;
output = 1.0 ./ (1.0 + exp(-output)); % Output Gate
% Cell State
cellgate=F.*c+I.*G; % Cell Gate
cellgate=cellgate;
% Output (Hidden) State
hidden=O.*tanh(cellgate); % Output State
hidden=dlarray(hidden);
L1 = relu(hidden);
Code for calculate output in fullyconnected Layer:
Fc=Fc_W*L1+Fc_B lstm, weight, interpret, deep learning MATLAB Answers — New Questions
How to remove repeating elements but maintain occurrences in an array?
Is there a way that I can get the first occurrence of consecutively repeating values, even if the same value occurs at few different places in the matrix?
Say I have a matrix
X=[2 2 2 2 -1 -1 -1 6 6 6 6 6 5 5 5 2 2 2 2 7 7 6 6]
I want the result to be
ans=[2 -1 6 5 2 7 6].
I’ve checked a similar question <http://www.mathworks.com/matlabcentral/answers/16667-how-to-remove-repeating-elements-from-an-array How to remove repeating elements from an array> but using unique and keeping the same order as original matrix gives
ans=[2 -1 6 5 7].
I know I can use a loop like below. But I was wondering if there’s a function for this.
for i=1:(length(X)-1)
if (X(i+1,6)-X(i,6))~=0
ans(i,1)=X(i+1,6);
else
ans(i,1)=NaN;
end
end
A function to do this will be great.Is there a way that I can get the first occurrence of consecutively repeating values, even if the same value occurs at few different places in the matrix?
Say I have a matrix
X=[2 2 2 2 -1 -1 -1 6 6 6 6 6 5 5 5 2 2 2 2 7 7 6 6]
I want the result to be
ans=[2 -1 6 5 2 7 6].
I’ve checked a similar question <http://www.mathworks.com/matlabcentral/answers/16667-how-to-remove-repeating-elements-from-an-array How to remove repeating elements from an array> but using unique and keeping the same order as original matrix gives
ans=[2 -1 6 5 7].
I know I can use a loop like below. But I was wondering if there’s a function for this.
for i=1:(length(X)-1)
if (X(i+1,6)-X(i,6))~=0
ans(i,1)=X(i+1,6);
else
ans(i,1)=NaN;
end
end
A function to do this will be great. Is there a way that I can get the first occurrence of consecutively repeating values, even if the same value occurs at few different places in the matrix?
Say I have a matrix
X=[2 2 2 2 -1 -1 -1 6 6 6 6 6 5 5 5 2 2 2 2 7 7 6 6]
I want the result to be
ans=[2 -1 6 5 2 7 6].
I’ve checked a similar question <http://www.mathworks.com/matlabcentral/answers/16667-how-to-remove-repeating-elements-from-an-array How to remove repeating elements from an array> but using unique and keeping the same order as original matrix gives
ans=[2 -1 6 5 7].
I know I can use a loop like below. But I was wondering if there’s a function for this.
for i=1:(length(X)-1)
if (X(i+1,6)-X(i,6))~=0
ans(i,1)=X(i+1,6);
else
ans(i,1)=NaN;
end
end
A function to do this will be great. array, repeating elements, unique, sort, matrix, matrix manipulation MATLAB Answers — New Questions
Why i am getting the wrong graph values Active and Non Active even in code even i used the if statment to check whether Kf_LMaxA, KfL_LMax and Cand D is constant or not
Greeting
Why i am getting the wrong graph Active and Non Active Receptor values when i put Kf_LMaxA,B;C;D = 0.01 even in code i used the if statment to check whether Kf_LMaxA, KfL_LMax and Cand D is constant or not . Kindly check and guide me where i am wrong. I attach the Source code and MATLAB GUI (Interface) and the screen shot.Greeting
Why i am getting the wrong graph Active and Non Active Receptor values when i put Kf_LMaxA,B;C;D = 0.01 even in code i used the if statment to check whether Kf_LMaxA, KfL_LMax and Cand D is constant or not . Kindly check and guide me where i am wrong. I attach the Source code and MATLAB GUI (Interface) and the screen shot. Greeting
Why i am getting the wrong graph Active and Non Active Receptor values when i put Kf_LMaxA,B;C;D = 0.01 even in code i used the if statment to check whether Kf_LMaxA, KfL_LMax and Cand D is constant or not . Kindly check and guide me where i am wrong. I attach the Source code and MATLAB GUI (Interface) and the screen shot. matlab coder MATLAB Answers — New Questions
extracting area of cracks from image
Dear all, I wrote this code to extract cracks from a tomography image. I tried many ways to remove the background and enhance the colors for better crack extraction, but some cracks are still missing. Can anyone help me improve the code?
clear all
close all
clc
A= imread(‘image_1567.png’);
[rows, columns, numberOfColorChannels] = size(A);
[centers,radii] = imfindcircles(A,[500 650],Sensitivity=0.95);
mask = circles2mask(centers,radii,size(A));
new_image = A;
new_image(~mask) = nan;
figure(1)
sigma = 20;
Iflatfield = imflatfield(new_image,sigma);
imshow(Iflatfield)
figure(2)
imhist(Iflatfield);
figure(3)
crackMask = Iflatfield < 50;
imshow(crackMask)Dear all, I wrote this code to extract cracks from a tomography image. I tried many ways to remove the background and enhance the colors for better crack extraction, but some cracks are still missing. Can anyone help me improve the code?
clear all
close all
clc
A= imread(‘image_1567.png’);
[rows, columns, numberOfColorChannels] = size(A);
[centers,radii] = imfindcircles(A,[500 650],Sensitivity=0.95);
mask = circles2mask(centers,radii,size(A));
new_image = A;
new_image(~mask) = nan;
figure(1)
sigma = 20;
Iflatfield = imflatfield(new_image,sigma);
imshow(Iflatfield)
figure(2)
imhist(Iflatfield);
figure(3)
crackMask = Iflatfield < 50;
imshow(crackMask) Dear all, I wrote this code to extract cracks from a tomography image. I tried many ways to remove the background and enhance the colors for better crack extraction, but some cracks are still missing. Can anyone help me improve the code?
clear all
close all
clc
A= imread(‘image_1567.png’);
[rows, columns, numberOfColorChannels] = size(A);
[centers,radii] = imfindcircles(A,[500 650],Sensitivity=0.95);
mask = circles2mask(centers,radii,size(A));
new_image = A;
new_image(~mask) = nan;
figure(1)
sigma = 20;
Iflatfield = imflatfield(new_image,sigma);
imshow(Iflatfield)
figure(2)
imhist(Iflatfield);
figure(3)
crackMask = Iflatfield < 50;
imshow(crackMask) image analysis, crack identification, iflatfield MATLAB Answers — New Questions
How can I isolate some objects from a image?
(hot_air_balloons.jpg)
(canyon.jpg)
I try to isolate the 4 yellow hot air balloons from the image to paste them to canyon.jpg (second image). I aim to obtain a binary image that the pixesls of hot air ballons white and all other areas black to be able to isolate them from rest of the image. Could you help me to obtain that binary image?(hot_air_balloons.jpg)
(canyon.jpg)
I try to isolate the 4 yellow hot air balloons from the image to paste them to canyon.jpg (second image). I aim to obtain a binary image that the pixesls of hot air ballons white and all other areas black to be able to isolate them from rest of the image. Could you help me to obtain that binary image? (hot_air_balloons.jpg)
(canyon.jpg)
I try to isolate the 4 yellow hot air balloons from the image to paste them to canyon.jpg (second image). I aim to obtain a binary image that the pixesls of hot air ballons white and all other areas black to be able to isolate them from rest of the image. Could you help me to obtain that binary image? binary, image, image processing MATLAB Answers — New Questions
Termination criterion for Genetic Algorithm when used in context of feature selection??
I have tried for 50 iterations but on running the Matlab code the best fitness value of all iterations is coming out to be different at different times. How will I decide which will be the best features in such a condition.
Getting different best feature set for same number of iterations. How results should be interpreted so that I can come to a Termination criterion??I have tried for 50 iterations but on running the Matlab code the best fitness value of all iterations is coming out to be different at different times. How will I decide which will be the best features in such a condition.
Getting different best feature set for same number of iterations. How results should be interpreted so that I can come to a Termination criterion?? I have tried for 50 iterations but on running the Matlab code the best fitness value of all iterations is coming out to be different at different times. How will I decide which will be the best features in such a condition.
Getting different best feature set for same number of iterations. How results should be interpreted so that I can come to a Termination criterion?? genetic algorithm MATLAB Answers — New Questions
Matlab 2024a creates “Downloads” folder automatically when start up
I installed matlab 2024a in CentOS Stream 9. It creates a folder named "Downloads" at my home directory everytime when I launch it. I really don’t like this feature. In the previous version, it can be solved by ‘userpath /path/prefer’. But it didn’t work for 2024a. Is there a way to avoid creating "Downloads"?I installed matlab 2024a in CentOS Stream 9. It creates a folder named "Downloads" at my home directory everytime when I launch it. I really don’t like this feature. In the previous version, it can be solved by ‘userpath /path/prefer’. But it didn’t work for 2024a. Is there a way to avoid creating "Downloads"? I installed matlab 2024a in CentOS Stream 9. It creates a folder named "Downloads" at my home directory everytime when I launch it. I really don’t like this feature. In the previous version, it can be solved by ‘userpath /path/prefer’. But it didn’t work for 2024a. Is there a way to avoid creating "Downloads"? matlab startup MATLAB Answers — New Questions
calling function from separate document for fitting
Hi all, I am working on this curve fitting project and I am trying out different methods to optimise the run time. One of the methods I am trying involes having 2 seperate scripts, with one script containing the function used for fitting and curve fitting (call this script 1), and the other script containing codes to load the data and process the data (call this script 2). However, when I try to call script 1 from 2, I get a ton of error messages. Could I please ask why is this the problem? Thank you! My codes are attached below:
tic
%% Preparation
clc; clear
format short
TAdata = readmatrix("FCPIB-293K-2.5mW-400nm-Jan072021 -ibg -bg -chirp.csv"); % insert file path within parenthesis
MBdata = readmatrix("carrier temp.xlsx");
P = load("Steady_State_Parameter_Values.mat");
Function = ‘Transient_Absorption’;
%% Preamble
% Fundamental constants
h = 4.1356677*10^-15; % units: eV/ Hz
c = 3*10^8; % SI units
kB = 8.617333268*10^-5; % units: eV/ K
% Data
Wavelength = TAdata(:, 1);% units: nm
E = (h*c)./(Wavelength*10^-9);
delay_t = TAdata(1, :);
delay_T = MBdata(:, 2);
carrier_T = MBdata(:, 3);
% Data for fitting
min_E = 1.5;
max_E = 2.0;
Range_E = E >= min_E & E <= max_E;
Range_W = Wavelength >= (h*c)/(max_E*10^-9) & Wavelength <= (h*c)/(min_E*10^-9);
E_p = E(Range_E); % selected probe energies
for n = 1:length(carrier_T)
a(1, n) = find(delay_T(n) == delay_t);
data_new2 = TAdata(Range_W, a);
end
%% Data for fitting and calling fitting function & solver
for i = 1:length(delay_T)
p = P.p;
A1 = p(1,1);
A2 = p(1,2);
Eg = p(1,3);
Eb = p(1,4);
R = p(1,5);
g = p(1,6);
deltaAbs = data_new2(:, i);
lb = [0, 0, 0, 0.3, 0, 0]; ub = [20, 0.05, 0.05, 2, 2, 1];
x0 = [1.6244, 0.0346, 0.03, 1.5139, 1, 0.3];
carrierT = carrier_T(i);
[x] = TA_fitting_function(A1, A2, Eg, Eb, R, g, x0,x,carrierT,E_p,deltaAbs,lb,ub,i,LegendText, Function);
end
%% Table of parameter values
time_delay = [‘0.5 ps’; ‘1.0 ps’; ‘2.0 ps’; ‘4.0 ps’];
Eg_prime = x(:, 1);
Eb_prime = x(:, 2);
g_prime = x(:, 3);
Ef_q = x(:, 4);
f1 = x(:, 5);
f2 = x(:, 6);
T = table(time_delay, Eg_prime, Eb_prime, g_prime, Ef_q, f1, f2);
disp(T)
tocHi all, I am working on this curve fitting project and I am trying out different methods to optimise the run time. One of the methods I am trying involes having 2 seperate scripts, with one script containing the function used for fitting and curve fitting (call this script 1), and the other script containing codes to load the data and process the data (call this script 2). However, when I try to call script 1 from 2, I get a ton of error messages. Could I please ask why is this the problem? Thank you! My codes are attached below:
tic
%% Preparation
clc; clear
format short
TAdata = readmatrix("FCPIB-293K-2.5mW-400nm-Jan072021 -ibg -bg -chirp.csv"); % insert file path within parenthesis
MBdata = readmatrix("carrier temp.xlsx");
P = load("Steady_State_Parameter_Values.mat");
Function = ‘Transient_Absorption’;
%% Preamble
% Fundamental constants
h = 4.1356677*10^-15; % units: eV/ Hz
c = 3*10^8; % SI units
kB = 8.617333268*10^-5; % units: eV/ K
% Data
Wavelength = TAdata(:, 1);% units: nm
E = (h*c)./(Wavelength*10^-9);
delay_t = TAdata(1, :);
delay_T = MBdata(:, 2);
carrier_T = MBdata(:, 3);
% Data for fitting
min_E = 1.5;
max_E = 2.0;
Range_E = E >= min_E & E <= max_E;
Range_W = Wavelength >= (h*c)/(max_E*10^-9) & Wavelength <= (h*c)/(min_E*10^-9);
E_p = E(Range_E); % selected probe energies
for n = 1:length(carrier_T)
a(1, n) = find(delay_T(n) == delay_t);
data_new2 = TAdata(Range_W, a);
end
%% Data for fitting and calling fitting function & solver
for i = 1:length(delay_T)
p = P.p;
A1 = p(1,1);
A2 = p(1,2);
Eg = p(1,3);
Eb = p(1,4);
R = p(1,5);
g = p(1,6);
deltaAbs = data_new2(:, i);
lb = [0, 0, 0, 0.3, 0, 0]; ub = [20, 0.05, 0.05, 2, 2, 1];
x0 = [1.6244, 0.0346, 0.03, 1.5139, 1, 0.3];
carrierT = carrier_T(i);
[x] = TA_fitting_function(A1, A2, Eg, Eb, R, g, x0,x,carrierT,E_p,deltaAbs,lb,ub,i,LegendText, Function);
end
%% Table of parameter values
time_delay = [‘0.5 ps’; ‘1.0 ps’; ‘2.0 ps’; ‘4.0 ps’];
Eg_prime = x(:, 1);
Eb_prime = x(:, 2);
g_prime = x(:, 3);
Ef_q = x(:, 4);
f1 = x(:, 5);
f2 = x(:, 6);
T = table(time_delay, Eg_prime, Eb_prime, g_prime, Ef_q, f1, f2);
disp(T)
toc Hi all, I am working on this curve fitting project and I am trying out different methods to optimise the run time. One of the methods I am trying involes having 2 seperate scripts, with one script containing the function used for fitting and curve fitting (call this script 1), and the other script containing codes to load the data and process the data (call this script 2). However, when I try to call script 1 from 2, I get a ton of error messages. Could I please ask why is this the problem? Thank you! My codes are attached below:
tic
%% Preparation
clc; clear
format short
TAdata = readmatrix("FCPIB-293K-2.5mW-400nm-Jan072021 -ibg -bg -chirp.csv"); % insert file path within parenthesis
MBdata = readmatrix("carrier temp.xlsx");
P = load("Steady_State_Parameter_Values.mat");
Function = ‘Transient_Absorption’;
%% Preamble
% Fundamental constants
h = 4.1356677*10^-15; % units: eV/ Hz
c = 3*10^8; % SI units
kB = 8.617333268*10^-5; % units: eV/ K
% Data
Wavelength = TAdata(:, 1);% units: nm
E = (h*c)./(Wavelength*10^-9);
delay_t = TAdata(1, :);
delay_T = MBdata(:, 2);
carrier_T = MBdata(:, 3);
% Data for fitting
min_E = 1.5;
max_E = 2.0;
Range_E = E >= min_E & E <= max_E;
Range_W = Wavelength >= (h*c)/(max_E*10^-9) & Wavelength <= (h*c)/(min_E*10^-9);
E_p = E(Range_E); % selected probe energies
for n = 1:length(carrier_T)
a(1, n) = find(delay_T(n) == delay_t);
data_new2 = TAdata(Range_W, a);
end
%% Data for fitting and calling fitting function & solver
for i = 1:length(delay_T)
p = P.p;
A1 = p(1,1);
A2 = p(1,2);
Eg = p(1,3);
Eb = p(1,4);
R = p(1,5);
g = p(1,6);
deltaAbs = data_new2(:, i);
lb = [0, 0, 0, 0.3, 0, 0]; ub = [20, 0.05, 0.05, 2, 2, 1];
x0 = [1.6244, 0.0346, 0.03, 1.5139, 1, 0.3];
carrierT = carrier_T(i);
[x] = TA_fitting_function(A1, A2, Eg, Eb, R, g, x0,x,carrierT,E_p,deltaAbs,lb,ub,i,LegendText, Function);
end
%% Table of parameter values
time_delay = [‘0.5 ps’; ‘1.0 ps’; ‘2.0 ps’; ‘4.0 ps’];
Eg_prime = x(:, 1);
Eb_prime = x(:, 2);
g_prime = x(:, 3);
Ef_q = x(:, 4);
f1 = x(:, 5);
f2 = x(:, 6);
T = table(time_delay, Eg_prime, Eb_prime, g_prime, Ef_q, f1, f2);
disp(T)
toc curve fitting MATLAB Answers — New Questions
how to add custom header to each file ?
How can i add custom header to each file in my project ? details like author, data created, short description about code etc.How can i add custom header to each file in my project ? details like author, data created, short description about code etc. How can i add custom header to each file in my project ? details like author, data created, short description about code etc. header MATLAB Answers — New Questions
Why is my coeff variable blank when I run PCA?
So I would like to conduct PCA on a dataset I have that is of sample size 23 and feature size 813 (nxp = 23×813). However, when I run the pca function, the coeff variable returned is blank. why is this the case? I am aware my sample size: feature size ratio is very low, but the function returned a 813×22 coefficient matrix when I ran it on my data before I processed it (transformed nonnormally distributed data & feature scaling) so I know it is not because of unsuitable data size.
I have attached a copy of the data I am trying to use if anyone is able to help; thanks!
[coeff, ~, latent] = pca(deltaEBC);
UPDATE: I was feature scaling by taking feature X, subtracting the mean of X, and dividing by the standard deviation of X. I changed this to simply subtracting the mean and not dividing by the std, and now the pca function does return a 813 x 22 coeff I was looking for. I just don’t know why?So I would like to conduct PCA on a dataset I have that is of sample size 23 and feature size 813 (nxp = 23×813). However, when I run the pca function, the coeff variable returned is blank. why is this the case? I am aware my sample size: feature size ratio is very low, but the function returned a 813×22 coefficient matrix when I ran it on my data before I processed it (transformed nonnormally distributed data & feature scaling) so I know it is not because of unsuitable data size.
I have attached a copy of the data I am trying to use if anyone is able to help; thanks!
[coeff, ~, latent] = pca(deltaEBC);
UPDATE: I was feature scaling by taking feature X, subtracting the mean of X, and dividing by the standard deviation of X. I changed this to simply subtracting the mean and not dividing by the std, and now the pca function does return a 813 x 22 coeff I was looking for. I just don’t know why? So I would like to conduct PCA on a dataset I have that is of sample size 23 and feature size 813 (nxp = 23×813). However, when I run the pca function, the coeff variable returned is blank. why is this the case? I am aware my sample size: feature size ratio is very low, but the function returned a 813×22 coefficient matrix when I ran it on my data before I processed it (transformed nonnormally distributed data & feature scaling) so I know it is not because of unsuitable data size.
I have attached a copy of the data I am trying to use if anyone is able to help; thanks!
[coeff, ~, latent] = pca(deltaEBC);
UPDATE: I was feature scaling by taking feature X, subtracting the mean of X, and dividing by the standard deviation of X. I changed this to simply subtracting the mean and not dividing by the std, and now the pca function does return a 813 x 22 coeff I was looking for. I just don’t know why? pca MATLAB Answers — New Questions
Which regressors do the parameter estimates belong to returned by ‘nlarx’?
I estimate a model using ‘nlarx’ from data like this
mdl = nlarx(data,sys);
Then, in the ‘mdl’ object has a field
mdl.Report.Parameters.ParVector
which lists the parameter estimates in a single column vector. Now, i see that the number of parameters estimates equal the number of ‘true’s in
sys.RegressorUsage
which is a table, however, I do not find information anywhere, in the Matlab documentation or on the internet, which individual instant of ‘true’ in sys.RegressorUsage, i.e., which individual regressors, belongs to which entry of mdl.Report.Parameters.ParVector.
Furthermore, i would like to ask where i can find p-values or standard errors for each of these parameter estimates.
Any help would be much appreciated!I estimate a model using ‘nlarx’ from data like this
mdl = nlarx(data,sys);
Then, in the ‘mdl’ object has a field
mdl.Report.Parameters.ParVector
which lists the parameter estimates in a single column vector. Now, i see that the number of parameters estimates equal the number of ‘true’s in
sys.RegressorUsage
which is a table, however, I do not find information anywhere, in the Matlab documentation or on the internet, which individual instant of ‘true’ in sys.RegressorUsage, i.e., which individual regressors, belongs to which entry of mdl.Report.Parameters.ParVector.
Furthermore, i would like to ask where i can find p-values or standard errors for each of these parameter estimates.
Any help would be much appreciated! I estimate a model using ‘nlarx’ from data like this
mdl = nlarx(data,sys);
Then, in the ‘mdl’ object has a field
mdl.Report.Parameters.ParVector
which lists the parameter estimates in a single column vector. Now, i see that the number of parameters estimates equal the number of ‘true’s in
sys.RegressorUsage
which is a table, however, I do not find information anywhere, in the Matlab documentation or on the internet, which individual instant of ‘true’ in sys.RegressorUsage, i.e., which individual regressors, belongs to which entry of mdl.Report.Parameters.ParVector.
Furthermore, i would like to ask where i can find p-values or standard errors for each of these parameter estimates.
Any help would be much appreciated! nlarx, regression, nonlinear model, system identification MATLAB Answers — New Questions
How to Install Signal Builder in Matlab 2023b
I have some scripts that directly create Signal Builder. How to solve the problem of signal builder being invalid after running the script in Matlab 2023b?I have some scripts that directly create Signal Builder. How to solve the problem of signal builder being invalid after running the script in Matlab 2023b? I have some scripts that directly create Signal Builder. How to solve the problem of signal builder being invalid after running the script in Matlab 2023b? signal builder MATLAB Answers — New Questions