Tag Archives: matlab
Matlab asks me to sign in when I’m offline
Matlab asks me to sign in when I’m offline, as this is impossible I can’t use Matlab while offline.
I can use Matlab no problem when I’m online and it does not ask me to sign in.
When I’m offline a Sign In window appears with this error:
Unable to contact login services. There may be a problem with your internet connection, or the service may be temporarily unavailable. If the problem persists contact MathWorks technical support.
Any fix for this?Matlab asks me to sign in when I’m offline, as this is impossible I can’t use Matlab while offline.
I can use Matlab no problem when I’m online and it does not ask me to sign in.
When I’m offline a Sign In window appears with this error:
Unable to contact login services. There may be a problem with your internet connection, or the service may be temporarily unavailable. If the problem persists contact MathWorks technical support.
Any fix for this? Matlab asks me to sign in when I’m offline, as this is impossible I can’t use Matlab while offline.
I can use Matlab no problem when I’m online and it does not ask me to sign in.
When I’m offline a Sign In window appears with this error:
Unable to contact login services. There may be a problem with your internet connection, or the service may be temporarily unavailable. If the problem persists contact MathWorks technical support.
Any fix for this? login, offline MATLAB Answers — New Questions
Bar chart from Excel with hidden columns
Hi there
I want to create the attached chart (plus an average line per section) with Matlab. I can do it super quick with Excel, but unfortunately it didn´t work well with Matlab.
There are three complications for me. 1 – How can I can exclude the hidden columns? 2 – What is the best way to deal with German numbers with comma instead of point? 3 -And Is there any way to have an average line per section?
Seems the "readtable" doesn´t work well with commas.
ThanksHi there
I want to create the attached chart (plus an average line per section) with Matlab. I can do it super quick with Excel, but unfortunately it didn´t work well with Matlab.
There are three complications for me. 1 – How can I can exclude the hidden columns? 2 – What is the best way to deal with German numbers with comma instead of point? 3 -And Is there any way to have an average line per section?
Seems the "readtable" doesn´t work well with commas.
Thanks Hi there
I want to create the attached chart (plus an average line per section) with Matlab. I can do it super quick with Excel, but unfortunately it didn´t work well with Matlab.
There are three complications for me. 1 – How can I can exclude the hidden columns? 2 – What is the best way to deal with German numbers with comma instead of point? 3 -And Is there any way to have an average line per section?
Seems the "readtable" doesn´t work well with commas.
Thanks excel MATLAB Answers — New Questions
how to mirror plots?
i hv theta value as 60 and 61 each theta value has phi of 120 240 with corresponding total values.
i hv to mirror data that is phi values data from 120 to 180 should be mirrored to 180 to 240 and then its plot is plotted. aim is to get plots symmetry xaxis is phi y axis is total with respect to theta percentile plots.i hv tried with excel sheet but my data is in .tab file how to import that format file and plot from it
a=xlsread(‘1GHzHH.xlsx’);
theta=a(:,1);
phi=a(:,2);
total=a(:,3);
figure
plot(phi,total)
% f=[1];
% pol=[‘HH”VV’];
%
% for i=1:size(pol)
% m=strcat(pol,’GHz’)
% j=strcat(f,m) %i m trying to read file which i hv imported file name is 1GHzHH.tab
% theta=data(:,1);
% phi=data(:,2);
% total=data(:,3);
% for j=1:nume1(theta)
% for k=1:nume1(phi)
%
% end
% end
% endi hv theta value as 60 and 61 each theta value has phi of 120 240 with corresponding total values.
i hv to mirror data that is phi values data from 120 to 180 should be mirrored to 180 to 240 and then its plot is plotted. aim is to get plots symmetry xaxis is phi y axis is total with respect to theta percentile plots.i hv tried with excel sheet but my data is in .tab file how to import that format file and plot from it
a=xlsread(‘1GHzHH.xlsx’);
theta=a(:,1);
phi=a(:,2);
total=a(:,3);
figure
plot(phi,total)
% f=[1];
% pol=[‘HH”VV’];
%
% for i=1:size(pol)
% m=strcat(pol,’GHz’)
% j=strcat(f,m) %i m trying to read file which i hv imported file name is 1GHzHH.tab
% theta=data(:,1);
% phi=data(:,2);
% total=data(:,3);
% for j=1:nume1(theta)
% for k=1:nume1(phi)
%
% end
% end
% end i hv theta value as 60 and 61 each theta value has phi of 120 240 with corresponding total values.
i hv to mirror data that is phi values data from 120 to 180 should be mirrored to 180 to 240 and then its plot is plotted. aim is to get plots symmetry xaxis is phi y axis is total with respect to theta percentile plots.i hv tried with excel sheet but my data is in .tab file how to import that format file and plot from it
a=xlsread(‘1GHzHH.xlsx’);
theta=a(:,1);
phi=a(:,2);
total=a(:,3);
figure
plot(phi,total)
% f=[1];
% pol=[‘HH”VV’];
%
% for i=1:size(pol)
% m=strcat(pol,’GHz’)
% j=strcat(f,m) %i m trying to read file which i hv imported file name is 1GHzHH.tab
% theta=data(:,1);
% phi=data(:,2);
% total=data(:,3);
% for j=1:nume1(theta)
% for k=1:nume1(phi)
%
% end
% end
% end plot MATLAB Answers — New Questions
How to convert euler angles to rotation matrix and back to euler angles consistently?
I want to compare the rotations from two different sources. However, I can do it only in R3, using Euler angles. However, it seems even for an elementary conversion, we don’t get matching euler vectors. I know that there can be non-unique representations for the same rotation matrix, but is there a way, where I can enforce some particular angle range output so that the vectors match? Maybe a constraint like rotation in Z has to be positive.
For eg.
%% Euler Angle -> Rotation Matrix -> Euler Angle
Rzc = -0.0030; Ryc = -2.4788; Rxc = 0.0180;
eul_seq_c_in = [Rzc, Ryc, Rxc]
rotm_c = eul2rotm(eul_seq_c_in);
eul_seq_c_out = rotm2eul(rotm_c)
%% Many to One Mapping for Euler Angle
eul2rotm(eul_seq_c_in)
eul2rotm(eul_seq_c_out)
For my application, all I get is a sequence of euler angles as an input. Then, I get a rotation transform independently, whose Euler sequence is calculated. And then I verify, if they represent the same rotation transform.I want to compare the rotations from two different sources. However, I can do it only in R3, using Euler angles. However, it seems even for an elementary conversion, we don’t get matching euler vectors. I know that there can be non-unique representations for the same rotation matrix, but is there a way, where I can enforce some particular angle range output so that the vectors match? Maybe a constraint like rotation in Z has to be positive.
For eg.
%% Euler Angle -> Rotation Matrix -> Euler Angle
Rzc = -0.0030; Ryc = -2.4788; Rxc = 0.0180;
eul_seq_c_in = [Rzc, Ryc, Rxc]
rotm_c = eul2rotm(eul_seq_c_in);
eul_seq_c_out = rotm2eul(rotm_c)
%% Many to One Mapping for Euler Angle
eul2rotm(eul_seq_c_in)
eul2rotm(eul_seq_c_out)
For my application, all I get is a sequence of euler angles as an input. Then, I get a rotation transform independently, whose Euler sequence is calculated. And then I verify, if they represent the same rotation transform. I want to compare the rotations from two different sources. However, I can do it only in R3, using Euler angles. However, it seems even for an elementary conversion, we don’t get matching euler vectors. I know that there can be non-unique representations for the same rotation matrix, but is there a way, where I can enforce some particular angle range output so that the vectors match? Maybe a constraint like rotation in Z has to be positive.
For eg.
%% Euler Angle -> Rotation Matrix -> Euler Angle
Rzc = -0.0030; Ryc = -2.4788; Rxc = 0.0180;
eul_seq_c_in = [Rzc, Ryc, Rxc]
rotm_c = eul2rotm(eul_seq_c_in);
eul_seq_c_out = rotm2eul(rotm_c)
%% Many to One Mapping for Euler Angle
eul2rotm(eul_seq_c_in)
eul2rotm(eul_seq_c_out)
For my application, all I get is a sequence of euler angles as an input. Then, I get a rotation transform independently, whose Euler sequence is calculated. And then I verify, if they represent the same rotation transform. rotation, transforms, euler MATLAB Answers — New Questions
EEG data Visualization for .mat file
I have an EEG data stored as . mat file , I want to visualize the EEG , What command should I use?
the sampling rate = 500
num of channels = 66
num of points = 250734
sample file is attached as image because the file size is too much big.I have an EEG data stored as . mat file , I want to visualize the EEG , What command should I use?
the sampling rate = 500
num of channels = 66
num of points = 250734
sample file is attached as image because the file size is too much big. I have an EEG data stored as . mat file , I want to visualize the EEG , What command should I use?
the sampling rate = 500
num of channels = 66
num of points = 250734
sample file is attached as image because the file size is too much big. eeg, image processing, visualization MATLAB Answers — New Questions
NaN issue and if statement
I’m having trouble with my code when I add an if condition to check if B_body(3) is less than 1e-5.
Without the if condition, everything works fine.
But when I add the if condition, I get a warning and B_body(3) values become NaN.
I’ve tried several solutions, but nothing works.
Any ideas on how to fix this?
epsilon=1e-5;
if abs(B_body(3))<epsilon
T_rw=[0;0;0];
else
T_rw = [0; 0; 1] * (B_body’ * T_commanded) / (B_body(3));
endI’m having trouble with my code when I add an if condition to check if B_body(3) is less than 1e-5.
Without the if condition, everything works fine.
But when I add the if condition, I get a warning and B_body(3) values become NaN.
I’ve tried several solutions, but nothing works.
Any ideas on how to fix this?
epsilon=1e-5;
if abs(B_body(3))<epsilon
T_rw=[0;0;0];
else
T_rw = [0; 0; 1] * (B_body’ * T_commanded) / (B_body(3));
end I’m having trouble with my code when I add an if condition to check if B_body(3) is less than 1e-5.
Without the if condition, everything works fine.
But when I add the if condition, I get a warning and B_body(3) values become NaN.
I’ve tried several solutions, but nothing works.
Any ideas on how to fix this?
epsilon=1e-5;
if abs(B_body(3))<epsilon
T_rw=[0;0;0];
else
T_rw = [0; 0; 1] * (B_body’ * T_commanded) / (B_body(3));
end nan MATLAB Answers — New Questions
Import numpy and scipy (maybe through Anaconda) in Matlab
(1) Introduction.
This is a follow up question of Call a Python function inside a MATLAB loop.
I am trying to run the following Python function (which is saved as anderson_darling.py) on Matlab:
def ADtest(a,b):
rng = np.random.default_rng()
method = stats.PermutationMethod(n_resamples=9999, random_state=rng)
res = stats.anderson_ksamp([a,b], method=method)
print(a)
print(b)
print(res.statistic)
print(res.critical_values)
print(res.pvalue)
if __name__ == "__main__":
import sys
import numpy as np
from scipy import stats
input_list1 = list(map(int, sys.argv[1].strip(‘[]’).split(‘,’)))
input_list2 = list(map(int, sys.argv[2].strip(‘[]’).split(‘,’)))
a = np.array(input_list1)
b = np.array(input_list2)
ADtest(a,b)
To run this file, I open a Terminal (throgh Visual Studio Code, but this is not relevant), and I give the following command:
(base) xyz@xyz myfolder % python3 anderson_darling.py "[1,3,5,6,4,6,7,1,2,7]" "[1,3,5,6,4,6,7,1,2,7]"
The result, that appears on the Terminal is the following:
[1 3 5 6 4 6 7 1 2 7] % <– array a
[1 3 5 6 4 6 7 1 2 7] % <– array b
-1.4363560826434034 % <– res.statistic
[0.325 1.226 1.961 2.718 3.752 4.592 6.546] % <– res.critical_values
1.0 % <– res.pvalue
(2) Problem.
Now, when I go to the editor of Matlab, I try to follow some indications of @Pavan Sahith, from Call a Python function inside a MATLAB loop:
a = [1,3,5,6,4,6,7,1,2,7];
b = [1,3,5,6,4,6,7,1,2,7];
% Convert MATLAB arrays to Python lists
py_a = py.list(a);
py_b = py.list(b);
py.anderson_darling.ADtest(py_a,py_b)
However, I get the following error on the Matlab Command Window:
Error using anderson_darling>ADtest
Python Error: NameError: name ‘np’ is not defined
(3) Potential source/reason of the problem & Question
I guess the problem is related to the way of importing "numpy" and "scipy" to Matlab. I found the following discussions on the Matlab forum, but it looks like they are related to Windows:
How to activate Anaconda environment in Matlab?
MATLAB Crashes when Using Conda Environment Other than Base
import numpy to matlab
problem with python numpy
I instead use Mac and I do not know what to do.
Therefore, how can I successfully import and use "numpy" and "scipy" to Matlab?
(4) Additional information on my system.
If it can help, my Python, Anaconda (the "numpy" and "scipy" packages are contained in (Ana)conda) and Matlab versions are the following ones:
From Terminal:
(base) xyz@xyz ~ % python3 –version
Python 3.12.4
(base) xyz@xyz ~ % conda –version
conda 24.7.1
(base) xyz@xyz ~ % conda info –envs
# conda environments:
#
base * /opt/anaconda3
/usr/local/anaconda3
From the Matlab’s Command Window:
% Python Version for your system (inside Matlab)
% https://ch.mathworks.com/help/matlab/ref/pyenv.html
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Library/Developer/CommandLineTools/usr/bin/python3"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "4128"
ProcessName: "MATLAB"
% Matlab version
>> version
ans =
‘23.2.0.2515942 (R2023b) Update 7′(1) Introduction.
This is a follow up question of Call a Python function inside a MATLAB loop.
I am trying to run the following Python function (which is saved as anderson_darling.py) on Matlab:
def ADtest(a,b):
rng = np.random.default_rng()
method = stats.PermutationMethod(n_resamples=9999, random_state=rng)
res = stats.anderson_ksamp([a,b], method=method)
print(a)
print(b)
print(res.statistic)
print(res.critical_values)
print(res.pvalue)
if __name__ == "__main__":
import sys
import numpy as np
from scipy import stats
input_list1 = list(map(int, sys.argv[1].strip(‘[]’).split(‘,’)))
input_list2 = list(map(int, sys.argv[2].strip(‘[]’).split(‘,’)))
a = np.array(input_list1)
b = np.array(input_list2)
ADtest(a,b)
To run this file, I open a Terminal (throgh Visual Studio Code, but this is not relevant), and I give the following command:
(base) xyz@xyz myfolder % python3 anderson_darling.py "[1,3,5,6,4,6,7,1,2,7]" "[1,3,5,6,4,6,7,1,2,7]"
The result, that appears on the Terminal is the following:
[1 3 5 6 4 6 7 1 2 7] % <– array a
[1 3 5 6 4 6 7 1 2 7] % <– array b
-1.4363560826434034 % <– res.statistic
[0.325 1.226 1.961 2.718 3.752 4.592 6.546] % <– res.critical_values
1.0 % <– res.pvalue
(2) Problem.
Now, when I go to the editor of Matlab, I try to follow some indications of @Pavan Sahith, from Call a Python function inside a MATLAB loop:
a = [1,3,5,6,4,6,7,1,2,7];
b = [1,3,5,6,4,6,7,1,2,7];
% Convert MATLAB arrays to Python lists
py_a = py.list(a);
py_b = py.list(b);
py.anderson_darling.ADtest(py_a,py_b)
However, I get the following error on the Matlab Command Window:
Error using anderson_darling>ADtest
Python Error: NameError: name ‘np’ is not defined
(3) Potential source/reason of the problem & Question
I guess the problem is related to the way of importing "numpy" and "scipy" to Matlab. I found the following discussions on the Matlab forum, but it looks like they are related to Windows:
How to activate Anaconda environment in Matlab?
MATLAB Crashes when Using Conda Environment Other than Base
import numpy to matlab
problem with python numpy
I instead use Mac and I do not know what to do.
Therefore, how can I successfully import and use "numpy" and "scipy" to Matlab?
(4) Additional information on my system.
If it can help, my Python, Anaconda (the "numpy" and "scipy" packages are contained in (Ana)conda) and Matlab versions are the following ones:
From Terminal:
(base) xyz@xyz ~ % python3 –version
Python 3.12.4
(base) xyz@xyz ~ % conda –version
conda 24.7.1
(base) xyz@xyz ~ % conda info –envs
# conda environments:
#
base * /opt/anaconda3
/usr/local/anaconda3
From the Matlab’s Command Window:
% Python Version for your system (inside Matlab)
% https://ch.mathworks.com/help/matlab/ref/pyenv.html
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Library/Developer/CommandLineTools/usr/bin/python3"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "4128"
ProcessName: "MATLAB"
% Matlab version
>> version
ans =
‘23.2.0.2515942 (R2023b) Update 7’ (1) Introduction.
This is a follow up question of Call a Python function inside a MATLAB loop.
I am trying to run the following Python function (which is saved as anderson_darling.py) on Matlab:
def ADtest(a,b):
rng = np.random.default_rng()
method = stats.PermutationMethod(n_resamples=9999, random_state=rng)
res = stats.anderson_ksamp([a,b], method=method)
print(a)
print(b)
print(res.statistic)
print(res.critical_values)
print(res.pvalue)
if __name__ == "__main__":
import sys
import numpy as np
from scipy import stats
input_list1 = list(map(int, sys.argv[1].strip(‘[]’).split(‘,’)))
input_list2 = list(map(int, sys.argv[2].strip(‘[]’).split(‘,’)))
a = np.array(input_list1)
b = np.array(input_list2)
ADtest(a,b)
To run this file, I open a Terminal (throgh Visual Studio Code, but this is not relevant), and I give the following command:
(base) xyz@xyz myfolder % python3 anderson_darling.py "[1,3,5,6,4,6,7,1,2,7]" "[1,3,5,6,4,6,7,1,2,7]"
The result, that appears on the Terminal is the following:
[1 3 5 6 4 6 7 1 2 7] % <– array a
[1 3 5 6 4 6 7 1 2 7] % <– array b
-1.4363560826434034 % <– res.statistic
[0.325 1.226 1.961 2.718 3.752 4.592 6.546] % <– res.critical_values
1.0 % <– res.pvalue
(2) Problem.
Now, when I go to the editor of Matlab, I try to follow some indications of @Pavan Sahith, from Call a Python function inside a MATLAB loop:
a = [1,3,5,6,4,6,7,1,2,7];
b = [1,3,5,6,4,6,7,1,2,7];
% Convert MATLAB arrays to Python lists
py_a = py.list(a);
py_b = py.list(b);
py.anderson_darling.ADtest(py_a,py_b)
However, I get the following error on the Matlab Command Window:
Error using anderson_darling>ADtest
Python Error: NameError: name ‘np’ is not defined
(3) Potential source/reason of the problem & Question
I guess the problem is related to the way of importing "numpy" and "scipy" to Matlab. I found the following discussions on the Matlab forum, but it looks like they are related to Windows:
How to activate Anaconda environment in Matlab?
MATLAB Crashes when Using Conda Environment Other than Base
import numpy to matlab
problem with python numpy
I instead use Mac and I do not know what to do.
Therefore, how can I successfully import and use "numpy" and "scipy" to Matlab?
(4) Additional information on my system.
If it can help, my Python, Anaconda (the "numpy" and "scipy" packages are contained in (Ana)conda) and Matlab versions are the following ones:
From Terminal:
(base) xyz@xyz ~ % python3 –version
Python 3.12.4
(base) xyz@xyz ~ % conda –version
conda 24.7.1
(base) xyz@xyz ~ % conda info –envs
# conda environments:
#
base * /opt/anaconda3
/usr/local/anaconda3
From the Matlab’s Command Window:
% Python Version for your system (inside Matlab)
% https://ch.mathworks.com/help/matlab/ref/pyenv.html
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Library/Developer/CommandLineTools/usr/bin/python3"
Library: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/libpython3.9.dylib"
Home: "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9"
Status: Loaded
ExecutionMode: InProcess
ProcessID: "4128"
ProcessName: "MATLAB"
% Matlab version
>> version
ans =
‘23.2.0.2515942 (R2023b) Update 7’ numpy, scipy, module, matlab, python, import, python function, anaconda, conda, python3, py, pyenv MATLAB Answers — New Questions
Why does opening Simulink for the first time in a MATLAB session take a long time?
Regardless of how I open Simulink, when I open it for the first time in a new MATLAB session, it takes almost 15 minutes to open. After the loading process, nothing else in Simulink is slow. How can I speed up this load time?Regardless of how I open Simulink, when I open it for the first time in a new MATLAB session, it takes almost 15 minutes to open. After the loading process, nothing else in Simulink is slow. How can I speed up this load time? Regardless of how I open Simulink, when I open it for the first time in a new MATLAB session, it takes almost 15 minutes to open. After the loading process, nothing else in Simulink is slow. How can I speed up this load time? MATLAB Answers — New Questions
Simulink Model Error – Please Help
Can u please help solve this error ?Can u please help solve this error ? Can u please help solve this error ? simulink MATLAB Answers — New Questions
Patch and fill functions are not shading area between confidence intervals in 2024a
I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated.I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated. I am trying to fill the area between two confidence intervals in Matlab 2024a. It is a depth-temperature chart where depth is Y and the confidence intervals are an upper and lower temperature bound in X. I have searched everything online, tried many things, and do not understand why the lines of the upper and lower bound will appear, but the area between the confidence intervals will not shade when calling both patch() and fill(). Here is a bit of my code:
clf;
plot(meanT, Depth, "r-", ‘LineWidth’, 2)
hold on
patch([Tlower; fliplr(Tupper)], [Depth; fliplr(Depth)], ‘g’)
Depth, meanT, Tlower, Tupper are all [nx1]. I have tried changing fliplr to flipud or just flip with no success. I have also tried transforming Tupper/Tlower to be sorted so they are smallest-to-largest and calling patch()/fill() on the sorted values. Same issue occurs. Any help to resolve this is much appreciated. patch, fill, shading MATLAB Answers — New Questions
I open Matlab after a computer crash and the editor is clear . Is there a file which stores which files were open prior to the crash?
Matlab closed incorrectly after a PC shutdown. When I restarted, all of the open m-files open in the editor have gone (as tabs, not from the hard drive). Is there any record of the open files anywhere?
ThksMatlab closed incorrectly after a PC shutdown. When I restarted, all of the open m-files open in the editor have gone (as tabs, not from the hard drive). Is there any record of the open files anywhere?
Thks Matlab closed incorrectly after a PC shutdown. When I restarted, all of the open m-files open in the editor have gone (as tabs, not from the hard drive). Is there any record of the open files anywhere?
Thks editor, files, crash MATLAB Answers — New Questions
Projecting circular motion on axes to derive linear accelerations
Good morning, everyone.
I am trying to create a .csv file that takes linear accelerations on the x and y axes, to recreate a circular motion as in the figure.
I have created the script to trace these values, and was wondering if I might be missing something.
Thanks in advance, i hope i haven’t violated any forum behaviour, in case, i apologise, it’s my first time posting.
% Parametri
r1 = 0.126; % raggio della prima circonferenza (m)
r2 = 0.042; % raggio della seconda circonferenza (m)
omega1 = 1.598; % velocità angolare prima circonferenza (rad/s)
omega2 = 4.794; % velocità angolare seconda circonferenza (rad/s)
dt = 0.0035; % intervallo di tempo (s)
t_total = 2.625; % tempo totale (s)
% Numero totale di punti
N = t_total / dt;
% Preallocazione di variabili
t = (0:N-1)’ * dt;
x = zeros(N, 1);
y = zeros(N, 1);
ax = zeros(N, 1);
ay = zeros(N, 1);
% Moto sulla prima circonferenza
t1 = 0:dt:(pi/omega1);
x(1:length(t1)) = -r1 * cos(omega1 * t1);
y(1:length(t1)) = r1 * sin(omega1 * t1);
ax(1:length(t1)) = -r1 * (omega1^2) * cos(omega1 * t1);
ay(1:length(t1)) = -r1 * (omega1^2) * sin(omega1 * t1);
% Moto sulla seconda circonferenza
% Calcolare il punto di partenza sulla seconda circonferenza (tangente alla prima)
x_shift = r1; % punto di partenza x sulla seconda circonferenza (tangente alla prima)
y_shift = 0; % punto di partenza y sulla seconda circonferenza
t2 = (pi/omega1):dt:t_total;
x(length(t1)+1:length(t1)+length(t2)) = (x_shift + r2) – r2 * cos(omega2 * (t2 – pi/omega1));
y(length(t1)+1:length(t1)+length(t2)) = -(y_shift + r2 * sin(omega2 * (t2 – pi/omega1)));
ax(length(t1)+1:length(t1)+length(t2)) = -r2 * (omega2^2) * cos(omega2 * (t2 – pi/omega1));
ay(length(t1)+1:length(t1)+length(t2)) = r2 * (omega2^2) * sin(omega2 * (t2 – pi/omega1));Good morning, everyone.
I am trying to create a .csv file that takes linear accelerations on the x and y axes, to recreate a circular motion as in the figure.
I have created the script to trace these values, and was wondering if I might be missing something.
Thanks in advance, i hope i haven’t violated any forum behaviour, in case, i apologise, it’s my first time posting.
% Parametri
r1 = 0.126; % raggio della prima circonferenza (m)
r2 = 0.042; % raggio della seconda circonferenza (m)
omega1 = 1.598; % velocità angolare prima circonferenza (rad/s)
omega2 = 4.794; % velocità angolare seconda circonferenza (rad/s)
dt = 0.0035; % intervallo di tempo (s)
t_total = 2.625; % tempo totale (s)
% Numero totale di punti
N = t_total / dt;
% Preallocazione di variabili
t = (0:N-1)’ * dt;
x = zeros(N, 1);
y = zeros(N, 1);
ax = zeros(N, 1);
ay = zeros(N, 1);
% Moto sulla prima circonferenza
t1 = 0:dt:(pi/omega1);
x(1:length(t1)) = -r1 * cos(omega1 * t1);
y(1:length(t1)) = r1 * sin(omega1 * t1);
ax(1:length(t1)) = -r1 * (omega1^2) * cos(omega1 * t1);
ay(1:length(t1)) = -r1 * (omega1^2) * sin(omega1 * t1);
% Moto sulla seconda circonferenza
% Calcolare il punto di partenza sulla seconda circonferenza (tangente alla prima)
x_shift = r1; % punto di partenza x sulla seconda circonferenza (tangente alla prima)
y_shift = 0; % punto di partenza y sulla seconda circonferenza
t2 = (pi/omega1):dt:t_total;
x(length(t1)+1:length(t1)+length(t2)) = (x_shift + r2) – r2 * cos(omega2 * (t2 – pi/omega1));
y(length(t1)+1:length(t1)+length(t2)) = -(y_shift + r2 * sin(omega2 * (t2 – pi/omega1)));
ax(length(t1)+1:length(t1)+length(t2)) = -r2 * (omega2^2) * cos(omega2 * (t2 – pi/omega1));
ay(length(t1)+1:length(t1)+length(t2)) = r2 * (omega2^2) * sin(omega2 * (t2 – pi/omega1)); Good morning, everyone.
I am trying to create a .csv file that takes linear accelerations on the x and y axes, to recreate a circular motion as in the figure.
I have created the script to trace these values, and was wondering if I might be missing something.
Thanks in advance, i hope i haven’t violated any forum behaviour, in case, i apologise, it’s my first time posting.
% Parametri
r1 = 0.126; % raggio della prima circonferenza (m)
r2 = 0.042; % raggio della seconda circonferenza (m)
omega1 = 1.598; % velocità angolare prima circonferenza (rad/s)
omega2 = 4.794; % velocità angolare seconda circonferenza (rad/s)
dt = 0.0035; % intervallo di tempo (s)
t_total = 2.625; % tempo totale (s)
% Numero totale di punti
N = t_total / dt;
% Preallocazione di variabili
t = (0:N-1)’ * dt;
x = zeros(N, 1);
y = zeros(N, 1);
ax = zeros(N, 1);
ay = zeros(N, 1);
% Moto sulla prima circonferenza
t1 = 0:dt:(pi/omega1);
x(1:length(t1)) = -r1 * cos(omega1 * t1);
y(1:length(t1)) = r1 * sin(omega1 * t1);
ax(1:length(t1)) = -r1 * (omega1^2) * cos(omega1 * t1);
ay(1:length(t1)) = -r1 * (omega1^2) * sin(omega1 * t1);
% Moto sulla seconda circonferenza
% Calcolare il punto di partenza sulla seconda circonferenza (tangente alla prima)
x_shift = r1; % punto di partenza x sulla seconda circonferenza (tangente alla prima)
y_shift = 0; % punto di partenza y sulla seconda circonferenza
t2 = (pi/omega1):dt:t_total;
x(length(t1)+1:length(t1)+length(t2)) = (x_shift + r2) – r2 * cos(omega2 * (t2 – pi/omega1));
y(length(t1)+1:length(t1)+length(t2)) = -(y_shift + r2 * sin(omega2 * (t2 – pi/omega1)));
ax(length(t1)+1:length(t1)+length(t2)) = -r2 * (omega2^2) * cos(omega2 * (t2 – pi/omega1));
ay(length(t1)+1:length(t1)+length(t2)) = r2 * (omega2^2) * sin(omega2 * (t2 – pi/omega1)); #circularmotion, #linearacceleration MATLAB Answers — New Questions
How to use FSOLVE with multiple variables?
Im trying to solve a problem that involves multiple variables and a paramether that chances on every interection.
If I try to run my main file appers this error:
error: ‘x’ undefined near line 40, column 37
error: called from
main at line 40 column 17
If someone could helps me with this problem I´ll be so greatfull.
>>
My code:
%%%%%%file 1 (main)
%fixed value
global M
M = 33180;
L = leitura_arq(‘arquivo1.txt’, M);
%h = 0.0001;
chute_inicial = [1,1];
% resolve sistem of equations
[x, fval, info] = fsolve (@equacoes(x, M, L), chute_inicial)
%%% FILE 2 (equacoes)
%file used to describe the equations
function F = equacoes (x, M, L)
%valores fixos
M = 33180;
%L = leitura_arq(‘arquivo1.txt’, M);
%x(1) = Betha
%x(2) = Lambda
F(1) = (x(1) * x(2) * M) – (x(1) * (1 / x(2))^(x(1) – 1) * somatorio1(L, x(1)));
F(2) = (M * log(1 / x(2))) + (x(2) * M) + log(sum(L)) – log(x(1));
end
%%%FILE 3 (leitura_arq)
% this file read a csv file and save these values
function L = leitura_arq(arquivo1, M)
L = zeros(1, M); % Inicializa o vetor com zeros
fid = fopen(arquivo1, ‘r’);
if fid == -1
error(‘Erro na abertura do arquivo.’);
else
disp(‘Arquivo aberto com sucesso.’);
for i = 1:M
L(i) = fscanf(fid, ‘%f’, 1);
end
fclose(fid);
end
end
%%% FILE 4 (somatorio1)
% this file do the interection and sum
function s1 = somatorio1(L, betha)
s1 = sum(L .^ betha);
endIm trying to solve a problem that involves multiple variables and a paramether that chances on every interection.
If I try to run my main file appers this error:
error: ‘x’ undefined near line 40, column 37
error: called from
main at line 40 column 17
If someone could helps me with this problem I´ll be so greatfull.
>>
My code:
%%%%%%file 1 (main)
%fixed value
global M
M = 33180;
L = leitura_arq(‘arquivo1.txt’, M);
%h = 0.0001;
chute_inicial = [1,1];
% resolve sistem of equations
[x, fval, info] = fsolve (@equacoes(x, M, L), chute_inicial)
%%% FILE 2 (equacoes)
%file used to describe the equations
function F = equacoes (x, M, L)
%valores fixos
M = 33180;
%L = leitura_arq(‘arquivo1.txt’, M);
%x(1) = Betha
%x(2) = Lambda
F(1) = (x(1) * x(2) * M) – (x(1) * (1 / x(2))^(x(1) – 1) * somatorio1(L, x(1)));
F(2) = (M * log(1 / x(2))) + (x(2) * M) + log(sum(L)) – log(x(1));
end
%%%FILE 3 (leitura_arq)
% this file read a csv file and save these values
function L = leitura_arq(arquivo1, M)
L = zeros(1, M); % Inicializa o vetor com zeros
fid = fopen(arquivo1, ‘r’);
if fid == -1
error(‘Erro na abertura do arquivo.’);
else
disp(‘Arquivo aberto com sucesso.’);
for i = 1:M
L(i) = fscanf(fid, ‘%f’, 1);
end
fclose(fid);
end
end
%%% FILE 4 (somatorio1)
% this file do the interection and sum
function s1 = somatorio1(L, betha)
s1 = sum(L .^ betha);
end Im trying to solve a problem that involves multiple variables and a paramether that chances on every interection.
If I try to run my main file appers this error:
error: ‘x’ undefined near line 40, column 37
error: called from
main at line 40 column 17
If someone could helps me with this problem I´ll be so greatfull.
>>
My code:
%%%%%%file 1 (main)
%fixed value
global M
M = 33180;
L = leitura_arq(‘arquivo1.txt’, M);
%h = 0.0001;
chute_inicial = [1,1];
% resolve sistem of equations
[x, fval, info] = fsolve (@equacoes(x, M, L), chute_inicial)
%%% FILE 2 (equacoes)
%file used to describe the equations
function F = equacoes (x, M, L)
%valores fixos
M = 33180;
%L = leitura_arq(‘arquivo1.txt’, M);
%x(1) = Betha
%x(2) = Lambda
F(1) = (x(1) * x(2) * M) – (x(1) * (1 / x(2))^(x(1) – 1) * somatorio1(L, x(1)));
F(2) = (M * log(1 / x(2))) + (x(2) * M) + log(sum(L)) – log(x(1));
end
%%%FILE 3 (leitura_arq)
% this file read a csv file and save these values
function L = leitura_arq(arquivo1, M)
L = zeros(1, M); % Inicializa o vetor com zeros
fid = fopen(arquivo1, ‘r’);
if fid == -1
error(‘Erro na abertura do arquivo.’);
else
disp(‘Arquivo aberto com sucesso.’);
for i = 1:M
L(i) = fscanf(fid, ‘%f’, 1);
end
fclose(fid);
end
end
%%% FILE 4 (somatorio1)
% this file do the interection and sum
function s1 = somatorio1(L, betha)
s1 = sum(L .^ betha);
end fsolve, multiplevariables MATLAB Answers — New Questions
Error using siteviewer with Application Compiler
When attempting to use siteviewer, in a standalone application created with the Application Compiler, the following error occurs:
"
Error using siteviewer
Expected Basemap to match one of these values:
‘darkwater’, ‘grayland’, ‘bluegreen’, ‘grayterrain’, ‘colorterrain’, ‘landcover’, ‘streets’, ‘streets-light’, ‘streets-dark’, ‘satellite’, ‘topographic’, ‘none’
The input, ‘usgsimagery’, did not match any of the valid values.
Error in siteViewTestwcomp (line 44)
MATLAB:graphics:maps:unrecognizedStringChoice
"
*****
Please note, the code executes as expected when run from the Matlab command prompt.
The error only manifests itself when attempting to run the executable generated from the App. Compiler.
Minimal code to create error:
% siteviewer
rtxTerrainMap_GLB = siteviewer(‘Basemap’,’satellite’,’Terrain’,’gmted2010′,’Name’,’Globe-Terrain Map’);
%%{
% longley rice initial parameters
propModel_ITM = propagationModel(…
"longley-rice",…
"AntennaPolarization","horizontal",…
"AtmosphericRefractivity",301,…
"ClimateZone","continental-temperate",…
"GroundConductivity",0.005,…
"GroundPermittivity",15,…
"SituationVariabilityTolerance",0.5,…
"TimeVariabilityTolerance",0.5…
);
% free space
propModel_FREESPACE = propagationModel(‘freespace’);
% rain atten
propModel_RAIN = propagationModel(‘rain’,’rainrate’,0);
% ref. ellipsoid
wgs84 = wgs84Ellipsoid("m");
%}
*****
Curiously, if I simply compile only the siteviewer, the executable runs correctly, and the siteveiwer globe opens.
% siteviewer
rtxTerrainMap_GLB = siteviewer(‘Basemap’,’satellite’,’Terrain’,’gmted2010′,’Name’,’Globe-Terrain Map’);
*****
Given that in all case the specified basemap is in the list of expected values, is there something I’m missing for the deployed version, why are the additional prop model definitions causing executable issue?
thank you in advance. Please let me know if any additional information is needed.
cpWhen attempting to use siteviewer, in a standalone application created with the Application Compiler, the following error occurs:
"
Error using siteviewer
Expected Basemap to match one of these values:
‘darkwater’, ‘grayland’, ‘bluegreen’, ‘grayterrain’, ‘colorterrain’, ‘landcover’, ‘streets’, ‘streets-light’, ‘streets-dark’, ‘satellite’, ‘topographic’, ‘none’
The input, ‘usgsimagery’, did not match any of the valid values.
Error in siteViewTestwcomp (line 44)
MATLAB:graphics:maps:unrecognizedStringChoice
"
*****
Please note, the code executes as expected when run from the Matlab command prompt.
The error only manifests itself when attempting to run the executable generated from the App. Compiler.
Minimal code to create error:
% siteviewer
rtxTerrainMap_GLB = siteviewer(‘Basemap’,’satellite’,’Terrain’,’gmted2010′,’Name’,’Globe-Terrain Map’);
%%{
% longley rice initial parameters
propModel_ITM = propagationModel(…
"longley-rice",…
"AntennaPolarization","horizontal",…
"AtmosphericRefractivity",301,…
"ClimateZone","continental-temperate",…
"GroundConductivity",0.005,…
"GroundPermittivity",15,…
"SituationVariabilityTolerance",0.5,…
"TimeVariabilityTolerance",0.5…
);
% free space
propModel_FREESPACE = propagationModel(‘freespace’);
% rain atten
propModel_RAIN = propagationModel(‘rain’,’rainrate’,0);
% ref. ellipsoid
wgs84 = wgs84Ellipsoid("m");
%}
*****
Curiously, if I simply compile only the siteviewer, the executable runs correctly, and the siteveiwer globe opens.
% siteviewer
rtxTerrainMap_GLB = siteviewer(‘Basemap’,’satellite’,’Terrain’,’gmted2010′,’Name’,’Globe-Terrain Map’);
*****
Given that in all case the specified basemap is in the list of expected values, is there something I’m missing for the deployed version, why are the additional prop model definitions causing executable issue?
thank you in advance. Please let me know if any additional information is needed.
cp When attempting to use siteviewer, in a standalone application created with the Application Compiler, the following error occurs:
"
Error using siteviewer
Expected Basemap to match one of these values:
‘darkwater’, ‘grayland’, ‘bluegreen’, ‘grayterrain’, ‘colorterrain’, ‘landcover’, ‘streets’, ‘streets-light’, ‘streets-dark’, ‘satellite’, ‘topographic’, ‘none’
The input, ‘usgsimagery’, did not match any of the valid values.
Error in siteViewTestwcomp (line 44)
MATLAB:graphics:maps:unrecognizedStringChoice
"
*****
Please note, the code executes as expected when run from the Matlab command prompt.
The error only manifests itself when attempting to run the executable generated from the App. Compiler.
Minimal code to create error:
% siteviewer
rtxTerrainMap_GLB = siteviewer(‘Basemap’,’satellite’,’Terrain’,’gmted2010′,’Name’,’Globe-Terrain Map’);
%%{
% longley rice initial parameters
propModel_ITM = propagationModel(…
"longley-rice",…
"AntennaPolarization","horizontal",…
"AtmosphericRefractivity",301,…
"ClimateZone","continental-temperate",…
"GroundConductivity",0.005,…
"GroundPermittivity",15,…
"SituationVariabilityTolerance",0.5,…
"TimeVariabilityTolerance",0.5…
);
% free space
propModel_FREESPACE = propagationModel(‘freespace’);
% rain atten
propModel_RAIN = propagationModel(‘rain’,’rainrate’,0);
% ref. ellipsoid
wgs84 = wgs84Ellipsoid("m");
%}
*****
Curiously, if I simply compile only the siteviewer, the executable runs correctly, and the siteveiwer globe opens.
% siteviewer
rtxTerrainMap_GLB = siteviewer(‘Basemap’,’satellite’,’Terrain’,’gmted2010′,’Name’,’Globe-Terrain Map’);
*****
Given that in all case the specified basemap is in the list of expected values, is there something I’m missing for the deployed version, why are the additional prop model definitions causing executable issue?
thank you in advance. Please let me know if any additional information is needed.
cp siteviewer, compiler, basemap satellite MATLAB Answers — New Questions
How can I activate my PolySpace products without an Internet connection as of release R2010a?
I would like more information about the activation of R2010a and higher PolySpace products without an Internet connection.I would like more information about the activation of R2010a and higher PolySpace products without an Internet connection. I would like more information about the activation of R2010a and higher PolySpace products without an Internet connection. MATLAB Answers — New Questions
Adding column in cell array before converting to a matrix.
I have a cell array with 23 X 1 doubles. Within each cell double there are two columns with thousands of rows.
Each of the 23 cells is representative of a sample in a project.
I need to convert this cell array into a matrix with all the data, but the final matrix needs to have an identifer with the cell name from the previous array (ex. 1,2,etc). The screenshot is an example of what I’m looking for within the first cell of the array. How do I add a column with values to one cell in a cell array?I have a cell array with 23 X 1 doubles. Within each cell double there are two columns with thousands of rows.
Each of the 23 cells is representative of a sample in a project.
I need to convert this cell array into a matrix with all the data, but the final matrix needs to have an identifer with the cell name from the previous array (ex. 1,2,etc). The screenshot is an example of what I’m looking for within the first cell of the array. How do I add a column with values to one cell in a cell array? I have a cell array with 23 X 1 doubles. Within each cell double there are two columns with thousands of rows.
Each of the 23 cells is representative of a sample in a project.
I need to convert this cell array into a matrix with all the data, but the final matrix needs to have an identifer with the cell name from the previous array (ex. 1,2,etc). The screenshot is an example of what I’m looking for within the first cell of the array. How do I add a column with values to one cell in a cell array? cell array MATLAB Answers — New Questions
How do I release or return a toolbox license key back to the pool of available keys without restarting the network license manager or exiting MATLAB?
I would like to know if it is possible to return the toolbox key back to the network license manager without closing/exiting the current MATLAB session.
I see the following message when I start MATLAB, or when I attempt to run a function from a toolbox even though no one else is using the license key:
ERROR: License Manager Error -4
Maximum number of users for "…" reached. Try again later.I would like to know if it is possible to return the toolbox key back to the network license manager without closing/exiting the current MATLAB session.
I see the following message when I start MATLAB, or when I attempt to run a function from a toolbox even though no one else is using the license key:
ERROR: License Manager Error -4
Maximum number of users for "…" reached. Try again later. I would like to know if it is possible to return the toolbox key back to the network license manager without closing/exiting the current MATLAB session.
I see the following message when I start MATLAB, or when I attempt to run a function from a toolbox even though no one else is using the license key:
ERROR: License Manager Error -4
Maximum number of users for "…" reached. Try again later. MATLAB Answers — New Questions
How to set a sample time in a Discrete Transfer Fcn??
I’m following the training of Simulink fundamentals, and I’m stucked trying to set the sample time on the parameters. Is not showing me that option to set it. I attached an image for you to view. Please I need some help with this is the only task that is left to end the course. Thanks in advance.I’m following the training of Simulink fundamentals, and I’m stucked trying to set the sample time on the parameters. Is not showing me that option to set it. I attached an image for you to view. Please I need some help with this is the only task that is left to end the course. Thanks in advance. I’m following the training of Simulink fundamentals, and I’m stucked trying to set the sample time on the parameters. Is not showing me that option to set it. I attached an image for you to view. Please I need some help with this is the only task that is left to end the course. Thanks in advance. simulink fundamentals, sample time, discrete transfer function, parameters, simulink MATLAB Answers — New Questions
Why does Python 3.6 fail to import MATLAB Engine and give a “DLL load failed” error?
I am using MATLAB R2018a. I have installed CPython 3.6.7 and installed MATLAB engine as mentioned in the documentation page obtained by running the following command on MATLAB R2018a:
web(fullfile(docroot, ‘matlab/matlab_external/install-the-matlab-engine-for-python.html’))
But I am getting the below error on executing "
import matlab.engine":
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION)
File "C:ProgramsPythonPython36libimportlib_
_init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘matlabengineforpython3_6’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:ProgramsPythonPython36libsite-packag
esmatlabengine__init__.py", line 59, in <module>
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSIO
N)
File "C:ProgramsPythonPython36libimportlib_
_init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:PythonPython36libsite-packag
esmatlabengine__init__.py", line 62, in <module>
‘MathWorks Technical Support for assistance: %s’ % e)
OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance: DLL load failed: The specified procedure could not be found.
The file C:Program FilesMATLABR2018aexternenginespythondistmatlabenginewin64matlabengineforpython3_6.pyd also got created.
Please follow the below link to search for the required information regarding the current release:https://www.mathworks.com/help/I am using MATLAB R2018a. I have installed CPython 3.6.7 and installed MATLAB engine as mentioned in the documentation page obtained by running the following command on MATLAB R2018a:
web(fullfile(docroot, ‘matlab/matlab_external/install-the-matlab-engine-for-python.html’))
But I am getting the below error on executing "
import matlab.engine":
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION)
File "C:ProgramsPythonPython36libimportlib_
_init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘matlabengineforpython3_6’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:ProgramsPythonPython36libsite-packag
esmatlabengine__init__.py", line 59, in <module>
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSIO
N)
File "C:ProgramsPythonPython36libimportlib_
_init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:PythonPython36libsite-packag
esmatlabengine__init__.py", line 62, in <module>
‘MathWorks Technical Support for assistance: %s’ % e)
OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance: DLL load failed: The specified procedure could not be found.
The file C:Program FilesMATLABR2018aexternenginespythondistmatlabenginewin64matlabengineforpython3_6.pyd also got created.
Please follow the below link to search for the required information regarding the current release:https://www.mathworks.com/help/ I am using MATLAB R2018a. I have installed CPython 3.6.7 and installed MATLAB engine as mentioned in the documentation page obtained by running the following command on MATLAB R2018a:
web(fullfile(docroot, ‘matlab/matlab_external/install-the-matlab-engine-for-python.html’))
But I am getting the below error on executing "
import matlab.engine":
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSION)
File "C:ProgramsPythonPython36libimportlib_
_init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘matlabengineforpython3_6’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:ProgramsPythonPython36libsite-packag
esmatlabengine__init__.py", line 59, in <module>
pythonengine = importlib.import_module("matlabengineforpython"+_PYTHONVERSIO
N)
File "C:ProgramsPythonPython36libimportlib_
_init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:PythonPython36libsite-packag
esmatlabengine__init__.py", line 62, in <module>
‘MathWorks Technical Support for assistance: %s’ % e)
OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance: DLL load failed: The specified procedure could not be found.
The file C:Program FilesMATLABR2018aexternenginespythondistmatlabenginewin64matlabengineforpython3_6.pyd also got created.
Please follow the below link to search for the required information regarding the current release:https://www.mathworks.com/help/ tbb, engine, api, python3 MATLAB Answers — New Questions
convert a cell Array into another cell
Hi, I have a cell array of A=1×490 cell,
A=
1×490 cell array
Columns 1 through 490
{512×200×32 single} {512×200×32 single} …..
How can I get
A=1×3136000 cell array
Columns 1 through 3136000
{512×1} {512×1} ….
PS:3136000=490*200*32
Thank you.
ChrisHi, I have a cell array of A=1×490 cell,
A=
1×490 cell array
Columns 1 through 490
{512×200×32 single} {512×200×32 single} …..
How can I get
A=1×3136000 cell array
Columns 1 through 3136000
{512×1} {512×1} ….
PS:3136000=490*200*32
Thank you.
Chris Hi, I have a cell array of A=1×490 cell,
A=
1×490 cell array
Columns 1 through 490
{512×200×32 single} {512×200×32 single} …..
How can I get
A=1×3136000 cell array
Columns 1 through 3136000
{512×1} {512×1} ….
PS:3136000=490*200*32
Thank you.
Chris cell array convert MATLAB Answers — New Questions