Category: Matlab
Category Archives: Matlab
Parallel computing on cell array.
Hello,
In my code I’ve created an object oriented data type named ‘particle’ as a custom defined class.
particle wth numeric fields (positionx, positiony, velocityx, velocityy).
Creating a new particle is via the constructor of the particle class.
p1 = particle(1,1,4,4);
Because there are lots of particles, these are all stored in a cell array (which can handle any data type).
pArray = cell(1,n);
pArray{1} = p1;
Then access to the fields of any particle is simply by the dot notation.
pArray{1}.positionx;
pArray{1}.positiony;
pArray{1}.velocityx;
pArray{1}.velocityy;
and so forth….
I wanted to process the particles in pArray more quickly by dividing them among workers of the parallel pool. So I decided to convert pArray from a cell array to a distributed cell array.
pArray = distributed(pArray)
But now the fields of each particle cannot be accessed by this method using the dot notation. I’ve tried this both inside an spmd block and outside of an spmd block
The line here
pArray(1).positionx
gives the following error.
Error using indexing (line 40)
Distributed SUBSREF only supports () indexing unless the underlying data type is table.
Error in distributed/subsref>iSubsRefHelper (line 126)
[varargout{:}] = subsref(coDd, substruct(s_type, varargin));
Error in distributedutil.distributedSpmdWrapper>iInnerWrapper (line 82)
[varargout{:}] = fcnH( varargin{:} );
Error in spmd_feval_fcn>get_f/body (line 78)
[outCell{:}] = fcnH( inCell{:} );
Then within an spmd block these lines
spmd
pArray(1).positionx;
end
gives this error.
Error using matlab_tests3 (line 80)
Error detected on workers 3 6 7 8.
Caused by:
Error using indexing (line 27)
Distributed arrays only support simple subscripting.
I’ve just started using Matlab’s parallel computing functionality so I’m just learning at this stage.
Is there a way to access the field data of an OO data structure stored in a cell array when using parallel computing techniques?
Any advice would be very helpful.
Thank you
Phil.Hello,
In my code I’ve created an object oriented data type named ‘particle’ as a custom defined class.
particle wth numeric fields (positionx, positiony, velocityx, velocityy).
Creating a new particle is via the constructor of the particle class.
p1 = particle(1,1,4,4);
Because there are lots of particles, these are all stored in a cell array (which can handle any data type).
pArray = cell(1,n);
pArray{1} = p1;
Then access to the fields of any particle is simply by the dot notation.
pArray{1}.positionx;
pArray{1}.positiony;
pArray{1}.velocityx;
pArray{1}.velocityy;
and so forth….
I wanted to process the particles in pArray more quickly by dividing them among workers of the parallel pool. So I decided to convert pArray from a cell array to a distributed cell array.
pArray = distributed(pArray)
But now the fields of each particle cannot be accessed by this method using the dot notation. I’ve tried this both inside an spmd block and outside of an spmd block
The line here
pArray(1).positionx
gives the following error.
Error using indexing (line 40)
Distributed SUBSREF only supports () indexing unless the underlying data type is table.
Error in distributed/subsref>iSubsRefHelper (line 126)
[varargout{:}] = subsref(coDd, substruct(s_type, varargin));
Error in distributedutil.distributedSpmdWrapper>iInnerWrapper (line 82)
[varargout{:}] = fcnH( varargin{:} );
Error in spmd_feval_fcn>get_f/body (line 78)
[outCell{:}] = fcnH( inCell{:} );
Then within an spmd block these lines
spmd
pArray(1).positionx;
end
gives this error.
Error using matlab_tests3 (line 80)
Error detected on workers 3 6 7 8.
Caused by:
Error using indexing (line 27)
Distributed arrays only support simple subscripting.
I’ve just started using Matlab’s parallel computing functionality so I’m just learning at this stage.
Is there a way to access the field data of an OO data structure stored in a cell array when using parallel computing techniques?
Any advice would be very helpful.
Thank you
Phil. Hello,
In my code I’ve created an object oriented data type named ‘particle’ as a custom defined class.
particle wth numeric fields (positionx, positiony, velocityx, velocityy).
Creating a new particle is via the constructor of the particle class.
p1 = particle(1,1,4,4);
Because there are lots of particles, these are all stored in a cell array (which can handle any data type).
pArray = cell(1,n);
pArray{1} = p1;
Then access to the fields of any particle is simply by the dot notation.
pArray{1}.positionx;
pArray{1}.positiony;
pArray{1}.velocityx;
pArray{1}.velocityy;
and so forth….
I wanted to process the particles in pArray more quickly by dividing them among workers of the parallel pool. So I decided to convert pArray from a cell array to a distributed cell array.
pArray = distributed(pArray)
But now the fields of each particle cannot be accessed by this method using the dot notation. I’ve tried this both inside an spmd block and outside of an spmd block
The line here
pArray(1).positionx
gives the following error.
Error using indexing (line 40)
Distributed SUBSREF only supports () indexing unless the underlying data type is table.
Error in distributed/subsref>iSubsRefHelper (line 126)
[varargout{:}] = subsref(coDd, substruct(s_type, varargin));
Error in distributedutil.distributedSpmdWrapper>iInnerWrapper (line 82)
[varargout{:}] = fcnH( varargin{:} );
Error in spmd_feval_fcn>get_f/body (line 78)
[outCell{:}] = fcnH( inCell{:} );
Then within an spmd block these lines
spmd
pArray(1).positionx;
end
gives this error.
Error using matlab_tests3 (line 80)
Error detected on workers 3 6 7 8.
Caused by:
Error using indexing (line 27)
Distributed arrays only support simple subscripting.
I’ve just started using Matlab’s parallel computing functionality so I’m just learning at this stage.
Is there a way to access the field data of an OO data structure stored in a cell array when using parallel computing techniques?
Any advice would be very helpful.
Thank you
Phil. parallel computing, cell array, object oriented data type. MATLAB Answers — New Questions
Why is my code seemingly ignoring some of the for loop commands?
Hello, I’m new to MATLAB and I’m trying to create a user-defined function that acts like bin2dec using manual conversion of binary to decimal integer, but I can’t figure out why I’m getting outputs of "1" or no output value for x altogether. Can someone please help me understand what’s wrong with my code? Thank you!!
% mybin2dec takes one single valued text input argument representation of a binary number and converts it to a decimal integer
function b=mybin2dec(x)
x=input(‘Enter a binary number as a text input: ‘, ‘s’)
str2num(x)
n=length(x)-1
for y=[1:length(x)]
if x(y)==49
d=(1*(2^n))
n=n-1
elseif x(y)==48
d=(0*(2^n))
n=n-1
end
end
sum(d)Hello, I’m new to MATLAB and I’m trying to create a user-defined function that acts like bin2dec using manual conversion of binary to decimal integer, but I can’t figure out why I’m getting outputs of "1" or no output value for x altogether. Can someone please help me understand what’s wrong with my code? Thank you!!
% mybin2dec takes one single valued text input argument representation of a binary number and converts it to a decimal integer
function b=mybin2dec(x)
x=input(‘Enter a binary number as a text input: ‘, ‘s’)
str2num(x)
n=length(x)-1
for y=[1:length(x)]
if x(y)==49
d=(1*(2^n))
n=n-1
elseif x(y)==48
d=(0*(2^n))
n=n-1
end
end
sum(d) Hello, I’m new to MATLAB and I’m trying to create a user-defined function that acts like bin2dec using manual conversion of binary to decimal integer, but I can’t figure out why I’m getting outputs of "1" or no output value for x altogether. Can someone please help me understand what’s wrong with my code? Thank you!!
% mybin2dec takes one single valued text input argument representation of a binary number and converts it to a decimal integer
function b=mybin2dec(x)
x=input(‘Enter a binary number as a text input: ‘, ‘s’)
str2num(x)
n=length(x)-1
for y=[1:length(x)]
if x(y)==49
d=(1*(2^n))
n=n-1
elseif x(y)==48
d=(0*(2^n))
n=n-1
end
end
sum(d) for loop, bin2dec MATLAB Answers — New Questions
No longer seeing data from sim800l and pic18f4525
I have a sim800l v2 and a pic18f. It was sending data to thinspeak last year uisng gprs and http post.
I have not changed anything but it seems to stop working. Has something changed on the thingspeak end?I have a sim800l v2 and a pic18f. It was sending data to thinspeak last year uisng gprs and http post.
I have not changed anything but it seems to stop working. Has something changed on the thingspeak end? I have a sim800l v2 and a pic18f. It was sending data to thinspeak last year uisng gprs and http post.
I have not changed anything but it seems to stop working. Has something changed on the thingspeak end? thingspeak MATLAB Answers — New Questions
How do I plot a quiver plot without the tail?
I want the (head) arrows on the curve and no tail.I want the (head) arrows on the curve and no tail. I want the (head) arrows on the curve and no tail. quiver MATLAB Answers — New Questions
How do i create and image from alpha-numeric characters?
I have a library say the alphabet and numbers, I have and images say Marilyn Monroe(grayscale) now i want to make the sales man problem and the nearest neighbor assign the best possible pixel representation to convert the image into this library of alpha-numeric pixels.I have a library say the alphabet and numbers, I have and images say Marilyn Monroe(grayscale) now i want to make the sales man problem and the nearest neighbor assign the best possible pixel representation to convert the image into this library of alpha-numeric pixels. I have a library say the alphabet and numbers, I have and images say Marilyn Monroe(grayscale) now i want to make the sales man problem and the nearest neighbor assign the best possible pixel representation to convert the image into this library of alpha-numeric pixels. image processing, digital image processing MATLAB Answers — New Questions
Matlab tool to plot 3d phase portrait
I have the following system of differential equations
x’ = -alpha0 * x + beta0 * x * y;
y’ = alpha1 * y – beta1 * x * y;
z’ = -alpha2 * (z – 5.5)^3 – beta2 * x * y;
I wanted to take a look at the phase portrait of this system for various values of the coefficients. Is there an inbuilt matlab tool that can do that?I have the following system of differential equations
x’ = -alpha0 * x + beta0 * x * y;
y’ = alpha1 * y – beta1 * x * y;
z’ = -alpha2 * (z – 5.5)^3 – beta2 * x * y;
I wanted to take a look at the phase portrait of this system for various values of the coefficients. Is there an inbuilt matlab tool that can do that? I have the following system of differential equations
x’ = -alpha0 * x + beta0 * x * y;
y’ = alpha1 * y – beta1 * x * y;
z’ = -alpha2 * (z – 5.5)^3 – beta2 * x * y;
I wanted to take a look at the phase portrait of this system for various values of the coefficients. Is there an inbuilt matlab tool that can do that? dynamical system, differential equations, phase portrait, phase plane MATLAB Answers — New Questions
FOPTD with sinusoidal input
Hi. I have a system and i want to study only the OPEN LOOP response for the disturbe.
Here x is a sinusoidal function x = w/(w^2 + s^2) and Pd is a FOPTD.
Can anyone help me with that?Hi. I have a system and i want to study only the OPEN LOOP response for the disturbe.
Here x is a sinusoidal function x = w/(w^2 + s^2) and Pd is a FOPTD.
Can anyone help me with that? Hi. I have a system and i want to study only the OPEN LOOP response for the disturbe.
Here x is a sinusoidal function x = w/(w^2 + s^2) and Pd is a FOPTD.
Can anyone help me with that? foptd MATLAB Answers — New Questions
How to install Lcc-win32 C 2.4.1 in matlap
I need the Lcc-win32 C 2.4.1 in C:PROGRA~2MATLABR2013A~1syslcc compiler but it does not appear in matlab and I tried to install it from online but it didn’t work…so how to get the Lcc-win32 C 2.4.1 to show in matlab?I need the Lcc-win32 C 2.4.1 in C:PROGRA~2MATLABR2013A~1syslcc compiler but it does not appear in matlab and I tried to install it from online but it didn’t work…so how to get the Lcc-win32 C 2.4.1 to show in matlab? I need the Lcc-win32 C 2.4.1 in C:PROGRA~2MATLABR2013A~1syslcc compiler but it does not appear in matlab and I tried to install it from online but it didn’t work…so how to get the Lcc-win32 C 2.4.1 to show in matlab? matlab compiler, mex compiler MATLAB Answers — New Questions
Splitting columns of a table
Hi I have a datafile : https://drive.google.com/file/d/1pYtIqvwfjOYDzvfjeudBE5XzmXmlJFiV/view?usp=drive_link
I am trying to store it in a table using following program. It is not letting me split certain columns that have arrays as values, into different columns. Each column should have just one value. I have tried replaing the delimiter, regexp and splitvars, but they didnt work at all.
………………………………………………………………………………………………………
files = dir(‘mvn_lpw_l2_lpnt_20150301_v03_r02.csv’);
tab = readtable(files.name)
…………………………………………………………………
Would appreciate some help here. ThanksHi I have a datafile : https://drive.google.com/file/d/1pYtIqvwfjOYDzvfjeudBE5XzmXmlJFiV/view?usp=drive_link
I am trying to store it in a table using following program. It is not letting me split certain columns that have arrays as values, into different columns. Each column should have just one value. I have tried replaing the delimiter, regexp and splitvars, but they didnt work at all.
………………………………………………………………………………………………………
files = dir(‘mvn_lpw_l2_lpnt_20150301_v03_r02.csv’);
tab = readtable(files.name)
…………………………………………………………………
Would appreciate some help here. Thanks Hi I have a datafile : https://drive.google.com/file/d/1pYtIqvwfjOYDzvfjeudBE5XzmXmlJFiV/view?usp=drive_link
I am trying to store it in a table using following program. It is not letting me split certain columns that have arrays as values, into different columns. Each column should have just one value. I have tried replaing the delimiter, regexp and splitvars, but they didnt work at all.
………………………………………………………………………………………………………
files = dir(‘mvn_lpw_l2_lpnt_20150301_v03_r02.csv’);
tab = readtable(files.name)
…………………………………………………………………
Would appreciate some help here. Thanks #splitcolumns #delimiters MATLAB Answers — New Questions
Convert 32 bit image to 8 bit image
Hey,
I have an .tif grayscale image with a bit depth of 32. I want to convert it from 32 bit to 8 bit. I tried using mat2gray, but every time I tried displaying the image after converting it, it didn’t look at all like it before. It was all black with only a few barely visible brighter spots. Does anyone know ho to properly perform the transformation?Hey,
I have an .tif grayscale image with a bit depth of 32. I want to convert it from 32 bit to 8 bit. I tried using mat2gray, but every time I tried displaying the image after converting it, it didn’t look at all like it before. It was all black with only a few barely visible brighter spots. Does anyone know ho to properly perform the transformation? Hey,
I have an .tif grayscale image with a bit depth of 32. I want to convert it from 32 bit to 8 bit. I tried using mat2gray, but every time I tried displaying the image after converting it, it didn’t look at all like it before. It was all black with only a few barely visible brighter spots. Does anyone know ho to properly perform the transformation? image processing, image analysis, image MATLAB Answers — New Questions
HOW RREFMOVIE IS PLACED IN THE MATLAB VERSION 2015?
HELM MEHELM ME HELM ME thanks MATLAB Answers — New Questions
Conway game of life problem – cycle start conditions..
Hey, I have been asked to find all the cycle start conditions in Game of Life, for a 10*10 square. Before that, I have written the code to the game, and a code which finds all the cycle start conditions for an n*n square, but the problem is that for that I have found all the possible start conditions (there are 2^n^2 of them) and for every start condition I implemented the rules for a finite number and checked if in some point I got a changed matrix that identical to my first matrix.
But this isn’t possible to 10*10 matrix because I need for that 2^100 matrices… ANOTHER IDEA ANYBODY?Hey, I have been asked to find all the cycle start conditions in Game of Life, for a 10*10 square. Before that, I have written the code to the game, and a code which finds all the cycle start conditions for an n*n square, but the problem is that for that I have found all the possible start conditions (there are 2^n^2 of them) and for every start condition I implemented the rules for a finite number and checked if in some point I got a changed matrix that identical to my first matrix.
But this isn’t possible to 10*10 matrix because I need for that 2^100 matrices… ANOTHER IDEA ANYBODY? Hey, I have been asked to find all the cycle start conditions in Game of Life, for a 10*10 square. Before that, I have written the code to the game, and a code which finds all the cycle start conditions for an n*n square, but the problem is that for that I have found all the possible start conditions (there are 2^n^2 of them) and for every start condition I implemented the rules for a finite number and checked if in some point I got a changed matrix that identical to my first matrix.
But this isn’t possible to 10*10 matrix because I need for that 2^100 matrices… ANOTHER IDEA ANYBODY? conway, game of life, matrix, overflow MATLAB Answers — New Questions
Getting amplitude from a noisy signal
I’m working on analyzing some data from a grain boundary in an atomic simulation; the included file has the relevant variables. I’ve got a lot of somewhat similar data to go through and am trying to determine a reliable way to get the amplitude of my data. There are a few complications that make the different tools I’m using difficult:
The x-axis location sometimes shifts forward and backwards, but usually by negligible amounts. My included code sorts it to be ascending simply because many solutions require it, but an implementation that doesn’t need to sort would reduce error.
The data has noise that make a lot of "false peaks" and "false valleys" that play havoc on using a simple findpeak function. Unfortunately, the sample rate for my data isn’t high enough to make this easy. Perhaps leveraging the periodic behavior of the signal could help?
My attempts to smooth out the noise with a filter drastically reduce the amplitude, when that is the variable I am trying to study. I’ve been using a 2nd order savitzky-golay filter via the sgolayfilt() command, but I do not know if that is the best fit for this work.
I have very little experience with signal processing, and only somewhat more with MatLab. I think a fourier decomposition and then reconstructing the signal would be my next best option, but after plotting the power spectrum and deciding that somewhere around 0.36 angstroms would be a good cutoff I’m not sure how to proceed. I feel like this would get an accurate periodicity, and then perhaps I could use a combination of movmean with movmax and movmin to get the original amplitude. It isn’t yet clear if the periodicity varies slightly.
The following code plots the power spectrum and frequency, then the actual data (sorted along x-axis).
%% Load data
Temp = ’10’;
fileName = [‘powerDump’, Temp, ‘.mat’];
load(fileName);
%% Sort data by position
[~,sortID] = sort(newGBLocation);
%% compute power spectrum
% pspectrum expects increasing second argument, but it moves erratically in
% the negative Z-direction and needs sorting
[p,f] = pspectrum(newPEAverage(sortID),newGBLocation(sortID)-min(newGBLocation));
% plot energy vs. position data [Angstroms]
figure
plot(newGBLocation(sortID)-min(newGBLocation),newPEAverage(sortID),’r-‘)
xlabel(‘Position $[AA]$’,’interpreter’,’latex’)
ylabel(‘Potential Energy [eV]’,’interpreter’,’latex’)
% plot power vs. wavelength [Angstroms]
figure;
plot(1./f,p);
xlabel(‘$lambda [AA]$’,’interpreter’,’latex’)
ylabel(‘Power’,’interpreter’,’latex’)
set(gca,’yscale’,’log’,’xscale’,’log’)
% plot power spectrum (power vs. frequency [1/Angstroms])
figure;
plot(f,p);
xlabel(‘$f [AA^{-1}]$’,’interpreter’,’latex’)
ylabel(‘Power’,’interpreter’,’latex’)
set(gca,’yscale’,’log’,’xscale’,’log’)I’m working on analyzing some data from a grain boundary in an atomic simulation; the included file has the relevant variables. I’ve got a lot of somewhat similar data to go through and am trying to determine a reliable way to get the amplitude of my data. There are a few complications that make the different tools I’m using difficult:
The x-axis location sometimes shifts forward and backwards, but usually by negligible amounts. My included code sorts it to be ascending simply because many solutions require it, but an implementation that doesn’t need to sort would reduce error.
The data has noise that make a lot of "false peaks" and "false valleys" that play havoc on using a simple findpeak function. Unfortunately, the sample rate for my data isn’t high enough to make this easy. Perhaps leveraging the periodic behavior of the signal could help?
My attempts to smooth out the noise with a filter drastically reduce the amplitude, when that is the variable I am trying to study. I’ve been using a 2nd order savitzky-golay filter via the sgolayfilt() command, but I do not know if that is the best fit for this work.
I have very little experience with signal processing, and only somewhat more with MatLab. I think a fourier decomposition and then reconstructing the signal would be my next best option, but after plotting the power spectrum and deciding that somewhere around 0.36 angstroms would be a good cutoff I’m not sure how to proceed. I feel like this would get an accurate periodicity, and then perhaps I could use a combination of movmean with movmax and movmin to get the original amplitude. It isn’t yet clear if the periodicity varies slightly.
The following code plots the power spectrum and frequency, then the actual data (sorted along x-axis).
%% Load data
Temp = ’10’;
fileName = [‘powerDump’, Temp, ‘.mat’];
load(fileName);
%% Sort data by position
[~,sortID] = sort(newGBLocation);
%% compute power spectrum
% pspectrum expects increasing second argument, but it moves erratically in
% the negative Z-direction and needs sorting
[p,f] = pspectrum(newPEAverage(sortID),newGBLocation(sortID)-min(newGBLocation));
% plot energy vs. position data [Angstroms]
figure
plot(newGBLocation(sortID)-min(newGBLocation),newPEAverage(sortID),’r-‘)
xlabel(‘Position $[AA]$’,’interpreter’,’latex’)
ylabel(‘Potential Energy [eV]’,’interpreter’,’latex’)
% plot power vs. wavelength [Angstroms]
figure;
plot(1./f,p);
xlabel(‘$lambda [AA]$’,’interpreter’,’latex’)
ylabel(‘Power’,’interpreter’,’latex’)
set(gca,’yscale’,’log’,’xscale’,’log’)
% plot power spectrum (power vs. frequency [1/Angstroms])
figure;
plot(f,p);
xlabel(‘$f [AA^{-1}]$’,’interpreter’,’latex’)
ylabel(‘Power’,’interpreter’,’latex’)
set(gca,’yscale’,’log’,’xscale’,’log’) I’m working on analyzing some data from a grain boundary in an atomic simulation; the included file has the relevant variables. I’ve got a lot of somewhat similar data to go through and am trying to determine a reliable way to get the amplitude of my data. There are a few complications that make the different tools I’m using difficult:
The x-axis location sometimes shifts forward and backwards, but usually by negligible amounts. My included code sorts it to be ascending simply because many solutions require it, but an implementation that doesn’t need to sort would reduce error.
The data has noise that make a lot of "false peaks" and "false valleys" that play havoc on using a simple findpeak function. Unfortunately, the sample rate for my data isn’t high enough to make this easy. Perhaps leveraging the periodic behavior of the signal could help?
My attempts to smooth out the noise with a filter drastically reduce the amplitude, when that is the variable I am trying to study. I’ve been using a 2nd order savitzky-golay filter via the sgolayfilt() command, but I do not know if that is the best fit for this work.
I have very little experience with signal processing, and only somewhat more with MatLab. I think a fourier decomposition and then reconstructing the signal would be my next best option, but after plotting the power spectrum and deciding that somewhere around 0.36 angstroms would be a good cutoff I’m not sure how to proceed. I feel like this would get an accurate periodicity, and then perhaps I could use a combination of movmean with movmax and movmin to get the original amplitude. It isn’t yet clear if the periodicity varies slightly.
The following code plots the power spectrum and frequency, then the actual data (sorted along x-axis).
%% Load data
Temp = ’10’;
fileName = [‘powerDump’, Temp, ‘.mat’];
load(fileName);
%% Sort data by position
[~,sortID] = sort(newGBLocation);
%% compute power spectrum
% pspectrum expects increasing second argument, but it moves erratically in
% the negative Z-direction and needs sorting
[p,f] = pspectrum(newPEAverage(sortID),newGBLocation(sortID)-min(newGBLocation));
% plot energy vs. position data [Angstroms]
figure
plot(newGBLocation(sortID)-min(newGBLocation),newPEAverage(sortID),’r-‘)
xlabel(‘Position $[AA]$’,’interpreter’,’latex’)
ylabel(‘Potential Energy [eV]’,’interpreter’,’latex’)
% plot power vs. wavelength [Angstroms]
figure;
plot(1./f,p);
xlabel(‘$lambda [AA]$’,’interpreter’,’latex’)
ylabel(‘Power’,’interpreter’,’latex’)
set(gca,’yscale’,’log’,’xscale’,’log’)
% plot power spectrum (power vs. frequency [1/Angstroms])
figure;
plot(f,p);
xlabel(‘$f [AA^{-1}]$’,’interpreter’,’latex’)
ylabel(‘Power’,’interpreter’,’latex’)
set(gca,’yscale’,’log’,’xscale’,’log’) signal processing, fft MATLAB Answers — New Questions
Matlab Coder, Compiler can’t find “tmwtypes.h”
Hello,
I got Matlab Code from the Neural Net Pattern Recognition Toolbox and I tried to generate C++ Code with the Matlab Coder.
But when I select Static Library or Source Code, Atmel AVR(8-bit) as Device (for Arduino) and the Arduino AVR toolchain the Arduino IDE always returns:
sketchgenerated_codeinterface_coder_NeuralNetwork_api.c:12:22: fatal error: tmwtypes.h: No such file or directory
#include "tmwtypes.h"
Why didn’t the Matlab Coder create that Library?Hello,
I got Matlab Code from the Neural Net Pattern Recognition Toolbox and I tried to generate C++ Code with the Matlab Coder.
But when I select Static Library or Source Code, Atmel AVR(8-bit) as Device (for Arduino) and the Arduino AVR toolchain the Arduino IDE always returns:
sketchgenerated_codeinterface_coder_NeuralNetwork_api.c:12:22: fatal error: tmwtypes.h: No such file or directory
#include "tmwtypes.h"
Why didn’t the Matlab Coder create that Library? Hello,
I got Matlab Code from the Neural Net Pattern Recognition Toolbox and I tried to generate C++ Code with the Matlab Coder.
But when I select Static Library or Source Code, Atmel AVR(8-bit) as Device (for Arduino) and the Arduino AVR toolchain the Arduino IDE always returns:
sketchgenerated_codeinterface_coder_NeuralNetwork_api.c:12:22: fatal error: tmwtypes.h: No such file or directory
#include "tmwtypes.h"
Why didn’t the Matlab Coder create that Library? maltab coder, tmwtypes.h, arduino MATLAB Answers — New Questions
need install function rrefmovie
Hello. How can i get function rrefmovie for my MatLab 2009?Hello. How can i get function rrefmovie for my MatLab 2009? Hello. How can i get function rrefmovie for my MatLab 2009? rrefmovie MATLAB Answers — New Questions
MATLAB does not start on OS X Sonoma M2 Max
MATLAB 2016b does not start since I upgraded OS X to Sonoma (OS X 14). I use a Mac with a M2 Max architecture. Befor upgrading to Sonoma it worked just fine. I know, that 2016b is not officially supported but maybe someone has an idea how I can fix this issue. I guess it should be possible because it war runnig just fine on the same machine before upgrading to Sonoma.
Trying to start Matlab with /Applications/MATLAB_R2016b.app/bin/matlab -glnxa64 gives the following error:
Warning: Cannot locate Java Runtime Environment (JRE) . . .
1. Either a correct JRE was not available for redistribution when
this release was shipped, in which case you should refer to the
Release Notes for additional information about how to get it.
2. Or you have tried to use the MATLAB_JAVA environment variable
to specify an alternate JRE, but MATLAB cannot find it. Please
run ‘matlab -n’ to determine what value you are using for
MATLAB_JAVA and fix accordingly.
—————————————————————————
matlab: No MATLAB bin directory for this machine architecture.
ARCH = glnxa64
Thank you and best regards,
PeterMATLAB 2016b does not start since I upgraded OS X to Sonoma (OS X 14). I use a Mac with a M2 Max architecture. Befor upgrading to Sonoma it worked just fine. I know, that 2016b is not officially supported but maybe someone has an idea how I can fix this issue. I guess it should be possible because it war runnig just fine on the same machine before upgrading to Sonoma.
Trying to start Matlab with /Applications/MATLAB_R2016b.app/bin/matlab -glnxa64 gives the following error:
Warning: Cannot locate Java Runtime Environment (JRE) . . .
1. Either a correct JRE was not available for redistribution when
this release was shipped, in which case you should refer to the
Release Notes for additional information about how to get it.
2. Or you have tried to use the MATLAB_JAVA environment variable
to specify an alternate JRE, but MATLAB cannot find it. Please
run ‘matlab -n’ to determine what value you are using for
MATLAB_JAVA and fix accordingly.
—————————————————————————
matlab: No MATLAB bin directory for this machine architecture.
ARCH = glnxa64
Thank you and best regards,
Peter MATLAB 2016b does not start since I upgraded OS X to Sonoma (OS X 14). I use a Mac with a M2 Max architecture. Befor upgrading to Sonoma it worked just fine. I know, that 2016b is not officially supported but maybe someone has an idea how I can fix this issue. I guess it should be possible because it war runnig just fine on the same machine before upgrading to Sonoma.
Trying to start Matlab with /Applications/MATLAB_R2016b.app/bin/matlab -glnxa64 gives the following error:
Warning: Cannot locate Java Runtime Environment (JRE) . . .
1. Either a correct JRE was not available for redistribution when
this release was shipped, in which case you should refer to the
Release Notes for additional information about how to get it.
2. Or you have tried to use the MATLAB_JAVA environment variable
to specify an alternate JRE, but MATLAB cannot find it. Please
run ‘matlab -n’ to determine what value you are using for
MATLAB_JAVA and fix accordingly.
—————————————————————————
matlab: No MATLAB bin directory for this machine architecture.
ARCH = glnxa64
Thank you and best regards,
Peter sonoma MATLAB Answers — New Questions
How can an ancient skull fossil be simulated?
I am a university professor of paleontology at the University of Florida, and I am working on scientific research on the physiological changes that could occur in an ancient skull that has been 5,000 years old, so that a natural simulation can be created, such as a three-dimensional spatial model that can explain the buried landmarks, the positions of the plasma inside the skull, and the protrusions that could be present in it. Realistic, as if it were real, so that after it is simulated, it is animated in space, rotating around the axis of the skull 360 degrees, and showing the jaw bones and orthodontics to complete the research work after completing the model.I am a university professor of paleontology at the University of Florida, and I am working on scientific research on the physiological changes that could occur in an ancient skull that has been 5,000 years old, so that a natural simulation can be created, such as a three-dimensional spatial model that can explain the buried landmarks, the positions of the plasma inside the skull, and the protrusions that could be present in it. Realistic, as if it were real, so that after it is simulated, it is animated in space, rotating around the axis of the skull 360 degrees, and showing the jaw bones and orthodontics to complete the research work after completing the model. I am a university professor of paleontology at the University of Florida, and I am working on scientific research on the physiological changes that could occur in an ancient skull that has been 5,000 years old, so that a natural simulation can be created, such as a three-dimensional spatial model that can explain the buried landmarks, the positions of the plasma inside the skull, and the protrusions that could be present in it. Realistic, as if it were real, so that after it is simulated, it is animated in space, rotating around the axis of the skull 360 degrees, and showing the jaw bones and orthodontics to complete the research work after completing the model. skull fossil be simulated MATLAB Answers — New Questions
How to recover the original signal using ifft
Hello everyone,
I’ve written a code to test the ifft function in MATLAB. However, I’ve noticed that ifft returns the same number of points as fft. I’m aiming to recover the original signal, which had 1000 points along with the time vector, t. How can I achieve this?
Thanks in advance for your help!
clear;clc;close all;
dt=2.5e-9;
f = 10e6;
Nfft=8*4096;
t = (0:1000-1)*dt;
sinal = sin(2*pi*f*t);
figure(1)
plot(t,sinal)
%Cálculo da fft
fftsinal=fft(sinal,Nfft);
%Transformada inversa de Fourier
sinal_recuperado = real(ifft(fftsinal,Nfft));
figure(2)
plot(1:Nfft,sinal_recuperado);Hello everyone,
I’ve written a code to test the ifft function in MATLAB. However, I’ve noticed that ifft returns the same number of points as fft. I’m aiming to recover the original signal, which had 1000 points along with the time vector, t. How can I achieve this?
Thanks in advance for your help!
clear;clc;close all;
dt=2.5e-9;
f = 10e6;
Nfft=8*4096;
t = (0:1000-1)*dt;
sinal = sin(2*pi*f*t);
figure(1)
plot(t,sinal)
%Cálculo da fft
fftsinal=fft(sinal,Nfft);
%Transformada inversa de Fourier
sinal_recuperado = real(ifft(fftsinal,Nfft));
figure(2)
plot(1:Nfft,sinal_recuperado); Hello everyone,
I’ve written a code to test the ifft function in MATLAB. However, I’ve noticed that ifft returns the same number of points as fft. I’m aiming to recover the original signal, which had 1000 points along with the time vector, t. How can I achieve this?
Thanks in advance for your help!
clear;clc;close all;
dt=2.5e-9;
f = 10e6;
Nfft=8*4096;
t = (0:1000-1)*dt;
sinal = sin(2*pi*f*t);
figure(1)
plot(t,sinal)
%Cálculo da fft
fftsinal=fft(sinal,Nfft);
%Transformada inversa de Fourier
sinal_recuperado = real(ifft(fftsinal,Nfft));
figure(2)
plot(1:Nfft,sinal_recuperado); signal recovery MATLAB Answers — New Questions
How to find pixels aligned along a certain direction on satellite image?
Hi everyone.
I need some help.
This image represents all the hot pixels recognized in a certain period of time by analysis of sentinel-2. As you see on the left there are many anomalous pixels that are not actually really hot, but are recognized as anomalous because of the seam/stripes artifact effect in the sentinel-2 images.
I need to eliminate these pixels. Is there an automatic way to recognize pixels aligned in a certain direction, and/or to recognize automatically those pixels on the left part of the image?
Thanks!Hi everyone.
I need some help.
This image represents all the hot pixels recognized in a certain period of time by analysis of sentinel-2. As you see on the left there are many anomalous pixels that are not actually really hot, but are recognized as anomalous because of the seam/stripes artifact effect in the sentinel-2 images.
I need to eliminate these pixels. Is there an automatic way to recognize pixels aligned in a certain direction, and/or to recognize automatically those pixels on the left part of the image?
Thanks! Hi everyone.
I need some help.
This image represents all the hot pixels recognized in a certain period of time by analysis of sentinel-2. As you see on the left there are many anomalous pixels that are not actually really hot, but are recognized as anomalous because of the seam/stripes artifact effect in the sentinel-2 images.
I need to eliminate these pixels. Is there an automatic way to recognize pixels aligned in a certain direction, and/or to recognize automatically those pixels on the left part of the image?
Thanks! pixel, line, sentinel-2, satellite MATLAB Answers — New Questions
Cross-correlation in frequency domain and xcorr2 in MATLAB
What are the reasons for the differences between my frequency domain cross-correlation results and those obtained using the xcorr2() function in MATLAB? Is it possible that xcorr2() performs spatial domain cross-correlation, and how might this affect the results?
img1 = imread(‘1.jpg’);
img2 = imread(‘2.jpg’);
img1_gray = rgb2gray(img1);
img2_gray = rgb2gray(img2);
[m, n] = size(img1_gray);
[p, q] = size(img2_gray);
fft_img1 = fft2(img1_gray, m + p – 1, n + q – 1);
fft_img2 = fft2(img2_gray, m + p – 1, n + q – 1);
cross_correlation = (fft_img1 .* conj(fft_img2));
cross_correlation = ifft2(cross_correlation);
cross_correlation = fftshift(cross_correlation);
cross_correlation_xcorr2 = xcorr2(img2_gray, img1_gray);
figure;
subplot(2, 1, 1);
imshow(cross_correlation, []);
title(‘Custom Cross-Correlation’);
subplot(2, 1, 2);
imshow(cross_correlation_xcorr2, []);
title(‘xcorr2’);
Results:What are the reasons for the differences between my frequency domain cross-correlation results and those obtained using the xcorr2() function in MATLAB? Is it possible that xcorr2() performs spatial domain cross-correlation, and how might this affect the results?
img1 = imread(‘1.jpg’);
img2 = imread(‘2.jpg’);
img1_gray = rgb2gray(img1);
img2_gray = rgb2gray(img2);
[m, n] = size(img1_gray);
[p, q] = size(img2_gray);
fft_img1 = fft2(img1_gray, m + p – 1, n + q – 1);
fft_img2 = fft2(img2_gray, m + p – 1, n + q – 1);
cross_correlation = (fft_img1 .* conj(fft_img2));
cross_correlation = ifft2(cross_correlation);
cross_correlation = fftshift(cross_correlation);
cross_correlation_xcorr2 = xcorr2(img2_gray, img1_gray);
figure;
subplot(2, 1, 1);
imshow(cross_correlation, []);
title(‘Custom Cross-Correlation’);
subplot(2, 1, 2);
imshow(cross_correlation_xcorr2, []);
title(‘xcorr2’);
Results: What are the reasons for the differences between my frequency domain cross-correlation results and those obtained using the xcorr2() function in MATLAB? Is it possible that xcorr2() performs spatial domain cross-correlation, and how might this affect the results?
img1 = imread(‘1.jpg’);
img2 = imread(‘2.jpg’);
img1_gray = rgb2gray(img1);
img2_gray = rgb2gray(img2);
[m, n] = size(img1_gray);
[p, q] = size(img2_gray);
fft_img1 = fft2(img1_gray, m + p – 1, n + q – 1);
fft_img2 = fft2(img2_gray, m + p – 1, n + q – 1);
cross_correlation = (fft_img1 .* conj(fft_img2));
cross_correlation = ifft2(cross_correlation);
cross_correlation = fftshift(cross_correlation);
cross_correlation_xcorr2 = xcorr2(img2_gray, img1_gray);
figure;
subplot(2, 1, 1);
imshow(cross_correlation, []);
title(‘Custom Cross-Correlation’);
subplot(2, 1, 2);
imshow(cross_correlation_xcorr2, []);
title(‘xcorr2’);
Results: matlab, digital image processing MATLAB Answers — New Questions