https://www.mathworks.com/matlabcentral/answers/questionsMATLAB Answers — New Questions2019-09-16T11:12:34Ztag:www.mathworks.com,2005:Question/4805852019-09-16T10:59:54Z2019-09-16T11:10:49ZHow can I find the vector from two points in 3D?
A = [0 3.8823 17.4889 ]
B = [ 0 3.8823 15.4889 ]
How to find AB vector for the given cooradinate in 3D.How to find AB vector for the given cooradinate in 3D.
rajesh regarhttps://www.mathworks.com/matlabcentral/profile/authors/15901752-rajesh-regartag:www.mathworks.com,2005:Question/4749082019-08-05T13:34:12Z2019-09-16T11:09:03ZWhy the angular velocities measured by bushing joint and transform sensor are differentI built a model of parallel manipulators using simMechanics, but I found that the angular velocities of the moving platform measured by bushing joint and transform sensor are different, so why?
Chong Zhaohttps://www.mathworks.com/matlabcentral/profile/authors/15682117-chong-zhaotag:www.mathworks.com,2005:Question/4801172019-09-12T15:26:10Z2019-09-16T11:08:07ZUnable to get the camera frame and at the same time perform serial communication with the bot without excessive delay.Hi,
I needed to perform a task where using the frames from the intel camera, I need to navigate the robot to perform collision avoidance. However, my code is unable to perform the task simultaneously. Both the .m files for serial communication of the bot (bot_serial.m) and for acquiring camera frames (values1.m) are attached.
I tried creating a function too for the camera frames and then called it in the bot_serial files but with this logic I am getting a single frame each time a condition is triggered in the bot_serial files and thus the camera cannot stream continuously and neither is the bot able to run continuously.
Please, help me with any possibility to continuously stream the camera and also run the bot at the same time. The values v1,v2 and v3 in values1.m file should be continuously updated and fed to the bot for it navigate accordingly.
Thanks.Ahad Maqsoodhttps://www.mathworks.com/matlabcentral/profile/authors/11823026-ahad-maqsoodtag:www.mathworks.com,2005:Question/4805592019-09-16T07:23:54Z2019-09-16T11:07:05Z'.' is not an internal or external command, nor is it a runnable program or batch filethis below is raw2jpeg.m:
function raw2jpeg(lfp_file)
cd('lfptools') ;
sys_command = ['./lfpsplitter ../' lfp_file];
system(sys_command,'-echo') ;
cd('..') ;
[lfp_folder, lfp_path , ~] = fileparts(lfp_file) ;
lfp_path = [lfp_folder '/' lfp_path] ;
fin = fopen(strcat(lfp_path, '_imageRef0.raw'), 'r') ;
meta = fopen(strcat(lfp_path, '_metadataRef0.txt'), 'r') ;
for i = 1:3
fgets(meta);
end
fgets(meta, 12)
width = fscanf(meta, '%d') ;
fgets(meta) ;
fgets(meta, 12) ;
height = fscanf(meta, '%d') ;
I = fread(fin, width*height, 'uint16=>uint16') ;
im_in = reshape(I, height, width) ;
im_in = im_in' ;
delete([lfp_path '_imageRef0.raw'], [lfp_path '_metadataRef0.txt'], ...
[lfp_path '_privateMetadataRef1.txt'], [lfp_path '_table.txt']) ;
im_in = im_in.*1.5 ;
imwrite(im2uint8(im_in), strcat(lfp_path,'.jpg')) ;
end
The code below is an example for raw2jpeg.m:
raw2jpeg('../input/dataset/raw.lfp'); (just one row)
And the result shows like this:
'.' is not an internal or external command, nor is it a runnable program or batch file
Incorrect use of fgets
The file identifier is invalid. Generate a valid file identifier using fopen (the error exists in line 11 of raw2jpeg.m)Huadong Huhttps://www.mathworks.com/matlabcentral/profile/authors/15291778-huadong-hutag:www.mathworks.com,2005:Question/2459592015-09-30T05:45:14Z2019-09-16T11:06:40ZHow to read text files from different sub folders in a folder ?I have a collection of .txt files which are an output of a simulation software.The software puts the text files in different sub-folders within a folder.Is it possible to read all of those ?
For example:- In a single folder named top, *there are 500 sub-folders(each subfolder is of format TC_SYS_01,TC_SYS_02,.....TC_SYS_500) with a text-file in each of them*.I want to read those text files from each of those folders & do some operations.
I'm thinking of changing the simulation software code itself so that it outputs txt files within a folder(no sub-folders) & use this code:
F = dir('*.txt');
for i = 1:length(F)
text = fileread(F(i).name) ;
% Do further operations
end
but can i do it without changing the simulation software code and this : <http://in.mathworks.com/matlabcentral/newsreader/view_thread/301929> doesn't help meLuffyhttps://www.mathworks.com/matlabcentral/profile/authors/3528849-luffytag:www.mathworks.com,2005:Question/4804252019-09-15T01:24:14Z2019-09-16T11:06:34ZMatlab code to calculate GPHow to write a code that can calculate GPAjani Joshuahttps://www.mathworks.com/matlabcentral/profile/authors/16235138-ajani-joshuatag:www.mathworks.com,2005:Question/4798792019-09-11T09:57:54Z2019-09-16T11:05:19ZReadtable for a huge (no good schema) CSV file!Hi All,
I have a tricky task of reading this huge csv file (1360x107037) . The example data is attached with this question and it just contains only few rows and columns. I tried importing it through the matlab function readtable.
What I did -
I tried to get the opts throught detectImportOptions()
As the delimiter is 'semi-colon', I assigned it to opts.Delimeter
Then I used readtable(filename, opts)
I got a table with 1360 rows and 107037 columns.
Problem -
I am getting in every even row for cells that supposed to be a string or datestring NaN values but all numerical values are retained
I tried to make the 7th line of the csv data as VariableNames but somehow I am getting Var1, Var2, ...... etc are the VariableNames
Does anyone know how could I get rid of these NaN values and obtain the actual string if exists or just an empty string and make the 7th line of the CSV file as the VariableNames.
Update 1
I guess it is expecting a number at that point but instead it is receiving a String!
Update 2
I did this -
opts.VariableTypes(1, 1:end) = {'char'};
Now I am getting all the values but now all the numbers are casted to 'char'!
I dropped all th eampty columns;
table (:, all(ismissing(table))) =[];
I thought of saving the Table as .mat for later use but (my stupidity) it contains now all 'char' values and the file is really huge!
Any help is appreciated!
Thanks & Cheers,
Savan
Savan Rangegowdahttps://www.mathworks.com/matlabcentral/profile/authors/16003379-savan-rangegowdatag:www.mathworks.com,2005:Question/4805792019-09-16T10:02:58Z2019-09-16T10:53:04Zcan any one provide a matlab code for a automatic enhancement of a perfect group photoHow to make a perfect group photo as the random snaps of a same photo are given..??
First we will assign a ranks to the face of a same person in different snaps based on his/her features i.e,open eyes/closed eyes and smile/nosmile.Later we select best snap of that person and repeat the same procedure for remaining faces of a persons in the image.After that we select a snap which has highest best faces based on their rank and we replace the remaining inferrior faces with respective best faces.
I want a matlab code for this Process
Please any one help me providing a matlab codeVineehttps://www.mathworks.com/matlabcentral/profile/authors/16247156-vineetag:www.mathworks.com,2005:Question/163902011-09-21T18:06:34Z2019-09-16T10:52:10ZInteger checkHow can i do an integer check in matlab? Say i have a number, a = 1.5, how do i check if it is integer or not? i want to use an if statement:
if non_integer(a) == true
end
so i need to know what to use for "non_integer", which would return a true or falseAndyhttps://www.mathworks.com/matlabcentral/profile/authors/3026764-andytag:www.mathworks.com,2005:Question/4804342019-09-15T07:54:44Z2019-09-16T10:51:46ZMatrix Dimensions Must AgreeHello I'm new to mathlab and I'm facing this issue. I'm gonna making image watermarking using dct method and this is my code, hope i can find the solution of this, thankyou beforeee
clc;
clear all
I=imread('Sunset.jpg'); I=imresize(I,[300 300]);
if size(I,3)==3
I=rgb2gray(I);
end
figure,imshow(I), title('CITRA Penampung')
W=imread('copyright1.png'); I=imresize(I,[300 300]);
if size(W,3)==3
W=rgb2gray(W);
end
figure,imshow(W), title('CITRA Watermark')
alpha = 0.02;
A = dct2(double(I));
B = dct2(double(W));
C = A + alpha*B;
Iw = round(real(idct2(C)));
IIw = uint8(Iw)
figure,imshow(IIw), title('CITRA Terwatermark')
I=imread('Sunset.jpg'); I=imresize(I,[300 300]);
if size(I,3)==3
I=rgb2gray(I);
end
A=dct2(double(I));
C1=dct2(double(Iw));
B1=(C1-A)./alpha;
W1=uint8(idct2(B1));
figure,imshow(W1), title('CITRA Watermark Hasil Ekstraksi')
%this is the error I get
Matrix dimensions must agree.
Error in dctcoba (line 19)
C = A + alpha*B;Mesita Widia Cahyaninghttps://www.mathworks.com/matlabcentral/profile/authors/16093295-mesita-widia-cahyaningtag:www.mathworks.com,2005:Question/4805702019-09-16T08:31:04Z2019-09-16T10:51:14ZSetting an equation equal to another variable (rearranging) in 2012bI took an integral in matlab and this was the output:
s =
3*5^(1/2)*t
or s = 3.
I want to rearage this equation in terms of .
I tried:
t = solve(s,t)
but the output is:
t1 =
0
I would greatly appreciate any insight!
p.s. I do have symbolic toolbox and have set:
syms t s t1Zayed Makboulhttps://www.mathworks.com/matlabcentral/profile/authors/16027229-zayed-makboultag:www.mathworks.com,2005:Question/4805842019-09-16T10:48:02Z2019-09-16T11:12:34ZTransfer function from power delay profile (PDP)Hi
I have measured the following delay profiles in an acoustic channel:
Delay:
210ms: -3db
320ms: -5db
530ms: -6db
Does anyone know how to make a transfer function out of this in Matlab so I can simulate the channel by convolution? Jepskihttps://www.mathworks.com/matlabcentral/profile/authors/6806520-jepskitag:www.mathworks.com,2005:Question/4805172019-09-15T23:35:52Z2019-09-16T10:44:57ZUse of Position property of figuresHi,
in the Command Window, when I execute the following as a single command
>> f = figure(1);plot(0);disp(f.Position);f.WindowState = 'maximized';disp(f.Position);
the printed outputs is
403 246 560 420
403 246 560 420
However, when I execute it as two separate commands,
>> f = figure(1);plot(0);disp(f.Position);f.WindowState = 'maximized';
and
>> disp(f.Position);
I get, respectively, the following two outputs:
403 246 560 420
1 41 1366 651
The second output is different (as I expected it to be). Why are the outputs different only when running the commands separately?
Thank you,
LT.Luca Tarasihttps://www.mathworks.com/matlabcentral/profile/authors/14016068-luca-tarasitag:www.mathworks.com,2005:Question/4801012019-09-12T14:25:18Z2019-09-16T10:42:12ZMATLAB 2R2019a Parallel Server : (MLM) UNSUPPORTED: "MATLAB" (PORT_AT_HOST_PLUS ) Dear support,
After instaling the license manager on ubuntu server, and installing matlab client on Redhat server, I could connect to the server but there were some error.
I noticed every call of matab it asks for activation, I insert the license.dat as described in documentation, but on the License manager server i get this error :
... (MLM) UNSUPPORTED: "MATLAB" (PORT_AT_HOST_PLUS ) root@client (No such feature exists. (-5,346)).
Could you please tell me what is the problem?
regards
Redouane Bouchouirbathttps://www.mathworks.com/matlabcentral/profile/authors/9695481-redouane-bouchouirbattag:www.mathworks.com,2005:Question/4805832019-09-16T10:41:33Z2019-09-16T10:41:33ZImport joint angle vectors of varying sizes from 1x2826 struct (2826 trials) and output data into an array, where each vector is in a separate row.I am trying to import joint angle data from a struct array containing 2826 trials of motion capture data (Xsens) using a for loop, and output the data into an array with 2826 rows each containing a specific joint angle vector. The vectors are varying sizes, as there are not the same number of frames in each trial.
If I only import one trial at a time it works fine:
for a = 1:length(Trials)
nSamples(a) = length(Trials(a).tree.subject.frames.frame);
end
if isfield(Trials(1).tree.subject.frames.frame(1),'jointAngle')
for b = 4:nSamples(1)
LeftKnee_FlexExt(b) = Trials(1).tree.subject.frames.frame(b).jointAngle(60);
RightKnee_FlexExt(b) = Trials(1).tree.subject.frames.frame(b).jointAngle(48);
end
end
I have tried to create a loop that imports all the 2826 trials to an array with rows of varying sizes, but I am stuck.
Thanks in advance for any assistance!
Sebastian Skalshttps://www.mathworks.com/matlabcentral/profile/authors/11902651-sebastian-skalstag:www.mathworks.com,2005:Question/4097782018-07-11T06:49:40Z2019-09-16T10:38:49ZDoes anyone have any knowledge regarding EPILAB software. I am having issues installing and I cannot find any documentation on the software. Any help would be appreciatedEpilab release by epileasia. Epilepsy siezure prediction MATLAB based softwareMatthew Bigelowhttps://www.mathworks.com/matlabcentral/profile/authors/10220989-matthew-bigelowtag:www.mathworks.com,2005:Question/4805822019-09-16T10:37:27Z2019-09-16T10:37:27ZIssue with Sigmoidnet input functionThis is the code I am using for generating the predicted output ('yo' as mentioned in the code) from given input ('u' as mentioned in the code) and output ('y' as mentioned in the code). Though I am getting 100% data fitting during training, the trained parametric sigmoidnet model ('sys' as mentioned in the code) is predicting completely different output from the same data used for training. Can soemone please help to find out bugs in the code if there are any? Furthermore, is there any alternative method to generate predicted output from given input using sigmoidnet function?
The code is written below:
data=iddata(y,u);
sys = nlarx(data,[2 2 1],sigmoidnet('NumberOfUnits',3))
% u is the input to the model
% y is true output of the model
% x is the regressor value vector, na=nb=2 and nk=1, so number of
% regressor=4
% yo is the predicted output
P = sys.Nonlinearity.Parameters.LinearSubspace;
r = sys.Nonlinearity.Parameters.RegressorMean;
L = sys.Nonlinearity.Parameters.LinearCoef;
Q = sys.Nonlinearity.Parameters.LinearSubspace;
b = sys.Nonlinearity.Parameters.Dilation;
c = sys.Nonlinearity.Parameters.Translation;
a = sys.Nonlinearity.Parameters.OutputCoef;
d = sys.Nonlinearity.Parameters.OutputOffset;
yo = [];
for i=1:size(u,1)
x= zeros(1,4);
if i==1
x(1)=0;
x(2)=0;
x(3)=0;
x(4)=0;
elseif i==2
x(1)=data.y(i-1);
x(2)=0;
x(3)=data.u(i-1);
x(4)=0;
else
x(1)=data.y(i-1);
x(2)=data.y(i-2);
x(3)=data.u(i-1);
x(4)=data.u(i-2);
end
y_element = (x-r)*P*L + a(1)*1/(exp(-((x-r)*Q*b(:,1) + c(1)) +1)) ...
+ a(2)*1/(exp(-((x-r)*Q*b(:,2) + c(2)) +1)) ...
+ a(3)*1/(exp(-((x-r)*Q*b(:,3) + c(3)) +1)) ...
+ d;
disp(y_element)
yo = [yo; y_element];
end
% Final predicted output for display
out_predict = yo;
Sharmila Biswashttps://www.mathworks.com/matlabcentral/profile/authors/15124479-sharmila-biswastag:www.mathworks.com,2005:Question/4805812019-09-16T10:08:32Z2019-09-16T10:32:20ZExtract data from heatmapI have plotted a heatmap using the built in "heatmap" function from a table that has xdata, ydata and zdata.
My X,Y data is jusy in a column with each on increasing.
The heatmap outputs the zdata to map the location given by xdata and ydata.
Is there away to extract this zdata as it appears (i.e. the positon) in the heatmap.
Thanks
JasonJasonhttps://www.mathworks.com/matlabcentral/profile/authors/1217570-jasontag:www.mathworks.com,2005:Question/1150972014-02-06T13:48:26Z2019-09-16T10:30:16Zhow to apply dwt and inverse dwt for an imagehi all..im writing a code for getting an image and perform dwt for one level to get 4 sub bands and apply inverse dwt to reconstruct the image.
The LL band should contain the intensity imformation of the image but for me the figure for LL is plain white and when tried for reconstructing image iam getting same white screen image.
i am not sure what was the mistake i have done.. the code i have written is shown below,
clear all;
close all;
i=imread('image22.jpg');
sX=size(i);
[LL,LH,HL,HH]=dwt2(i,'db1');
figure(1)
subplot(2,2,1);imshow(LL);title('LL band of image');
subplot(2,2,2);imshow(LH);title('LH band of image');
subplot(2,2,3);imshow(HL);title('HL band of image');
subplot(2,2,4);imshow(HH);title('HH band of image');
X = idwt2(LL,LH,HL,HH,'db1',sX);
figure(2)
imshow(X);
kindly help me to fix the same.Sathish Kumarhttps://www.mathworks.com/matlabcentral/profile/authors/2573145-sathish-kumartag:www.mathworks.com,2005:Question/4804452019-09-15T10:13:40Z2019-09-16T10:26:22ZCan't connect blocks in simulinkHello.
I made an RC, RL, CR, LR and couple of RLC circuits in simulink with ac voltage source which by default generates a sinusoidal wave as an input and they are connected to the scope as an output so i can see the behaviour of the signal. My next task is to simulate the work of these filters by having a different signal shape like sawtooth or square wave. When i try to drag&drop some sawtooth or square wave generator and connect it with the rest of the circuit i get red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you!
dino ninohttps://www.mathworks.com/matlabcentral/profile/authors/10480305-dino-ninotag:www.mathworks.com,2005:Question/4800752019-09-12T12:10:24Z2019-09-16T10:20:06ZBinary floating point Representation in MatlabFloating-point numbers are represented as
X=(-1)^s*m*2^c.
s: the sign
m:matissa
c:exponent
For example
The value 1.9844 as Binary floating point would be REF
0 01111111 11111100000000011010010
^ Sign bit
^^^^^^^^ Exponent
^^^^^^^^^^^^^^^^^^^^^^^ Fraction
But in matlab ,how doing the same work in this vector ?
A=[ 0.1900 -0.0300 -0.1300 0 0.1500 -0.0700 0.0500 0.1600 -0.2500 -0.1900];Johan Johanhttps://www.mathworks.com/matlabcentral/profile/authors/12590840-johan-johantag:www.mathworks.com,2005:Question/4805802019-09-16T10:03:28Z2019-09-16T10:14:03ZRun ImageJ plugin OrientationJ using MIJI from MatlabHi community,
I am trying to run the ImageJ plugin "OrientationJ Vector Field" out of Matlab and import the results table back to analyze the data automatically. My code currently looks like this:
javaaddpath('C:\Program Files\MATLAB\R2018b\java\jar\ij.jar');
javaaddpath('C:\Program Files\MATLAB\R2018b\java\jar\mij.jar');
Miji;
MIJ.run('Open...', 'path=[E:\Example_Image.tif]');
MIJ.run('OrientationJ Vector Field');
MIJ.run('OrientationJ Vector Field', 'tensor=2.0 gradient=0 radian=on vectorgrid=10 vectorscale=80.0 vectortype=0 vectoroverlay=on vectortable=on ');
res = MIJ.getResultsTable;
MIJ.closeAllWindows();
I currently have 2 problems:
MIJ.run('OrientationJ Vector Field',.... does not execute the plugin completely. A windows is opened where I need to click "run".
MIJ.getResultsTable won’t import results unless I rename it manually to "Results"
Are there ways around those problems?
MalteMalte Wallmeierhttps://www.mathworks.com/matlabcentral/profile/authors/12981459-malte-wallmeiertag:www.mathworks.com,2005:Question/4804442019-09-15T09:59:22Z2019-09-16T10:06:15ZFilling area between more curvesI am trying to colour the area between more curves (given also in implicite form) with one unbounded and transparent colour. This is example, how it should looks like (except from the red vertical line y=2):
And I have a same problem with planes. Is there any function to fill this "multiarea" or area between more surfaces?
I can only use fill, but it does not create comprehensive and transparent area between more curves.
Thank you.Anezka Koterovahttps://www.mathworks.com/matlabcentral/profile/authors/14864611-anezka-koterovatag:www.mathworks.com,2005:Question/4805772019-09-16T09:53:29Z2019-09-16T10:04:58ZHow to plot NEOHOOK and YEOH polynom in MatLab? How to plot NEOHOOK and YEOH polynom in MatLab? Is there a function built in MatLab?Marcus Johanssonhttps://www.mathworks.com/matlabcentral/profile/authors/14718082-marcus-johanssontag:www.mathworks.com,2005:Question/4801032019-09-12T14:41:25Z2019-09-16T10:04:23ZIs it possible to use simulink coder incompatible robotics toolbox functions using S-functions?Hi,
I am trying to develop a stand-alone ROS node in simulink that utilizes the robotics toolbox matchScansGrid() function.
But as simulink coder does not support code generation for the matchScansGrid() function (or any of the lidarSLAM tools), I was proposed an alternate method to use the matchScansGrid() in simulink:
Make a matlab function {eg testScanMatching() } that utilizes (or calls) the matchScansGrid().
Generate C code of this function (testScanMatching) using Matlab coder. This is possible as matchScansGrid() is supported by matlab coder.
Use the packNGo functionality
Unzip the output of step 3.
Use the legacy code to generate a compatible S-function (of testScanMatching)
Import it in simulink
Question:
Does this method work? Can I really use matchScansGrid() in simulink using this round-about way?
Is there a guide to implement S-functions from matlab coder generated C/C++ code ?
Thanks in advance.
note: I am testing this method but currently I have trouble building an S function from the code generated of testScanMatchingsoorajanilkumarhttps://www.mathworks.com/matlabcentral/profile/authors/13009447-soorajanilkumartag:www.mathworks.com,2005:Question/4805782019-09-16T09:56:41Z2019-09-16T10:04:04ZMATLAB R2017b UIListBox possible bug (ItemsData)Hello,
My name is Liron. I use MATLAB R2017b.
I’m currently working on an App Designer GUI, in which I use a UIListBox and assign data to each Item in the list.
The three properties related to my bug/issue are ‘Value’, ‘Items’ and ‘ItemsData’.
As far as I know:
The ‘Items’ property is a cell/string Array which determines the titles of the user’s possible choices.
The ‘Value’ property is the current chosen Item, highlighted in blue. Obviously, This ‘Value’ has to be the same as one of the ‘Items’.
The ‘ItemsData’ property is a 1-n cell/double array (where n = length(Items)) which allows us to assign additional, hidden data to each item in the list.
PROBLEM:
After setting ‘ItemsData’ to be anything else than an empty array, MATLAB mistakenly thinks the ‘Value’ is supposed to be one of the values of the ’ItemsData’(!) array, instead of the ‘Items’ array. In my specific case I’ve set the following:
% BEFORE ASSIGNING THE ‘ITEMSDATA’ PROPERTY:
>> App.nameListBox.ItemsData -> {} % check
>> App.nameListBox.Items = {‘option 1’};
>> App.nameListBox.Value = ‘option 1’; % Works good
% ASSIGNING THE ‘ITEMSDATA’ PROPERTY:
>> S = struct;
>> S.a = 1; % For instance
>> App.nameListBox.ItemsData = S;
>> App.nameListBox.Items -> {‘option 1’} % check
>> App.nameListBox.Value -> (the struct, S, even though I haven’t changed the ’Items’ property at all).
Does anyone have any idea why this happens? Is this a bug of this version of MATLAB? Have I done something wrong? Any suggestions?
Thank you very much.
Sincerely,
Liron StettinerLiron Stettinerhttps://www.mathworks.com/matlabcentral/profile/authors/9247183-liron-stettinertag:www.mathworks.com,2005:Question/4802382019-09-13T09:36:49Z2019-09-16T10:01:42ZAmplitudes or seat to head transmissibilities calculation? i wrote a code based on some already optimized parameters to calculate amplitude ratios but curve is not matching can any one help me to find out where is the mistake
clc
clear all
m1=5.5 ;m2= 20;m3=4.17;m4= 9.337 ;m5=15.856 ;m6= 5.807;
k1=49340 ;k2=20000;k3=10000;k4=134400 ;k5=2916 ;k6=146640;k7= 68064;
c1=2475;c2=330;c3=200;c4= 250;c5=316;c6=3252.9;c7=1606.3;
M=[m1 0 0 0 0 0 ;0 m2 0 0 0 0; 0 0 m3 0 0 0;0 0 0 m4 0 0;0 0 0 0 m5 0;0 0 0 0 0 m6];
K=[k1+k2+k7 -k2 0 0 -k7 0; -k2 k2+k3 -k3 0 0 0; 0 -k3 k3+k4 -k4 0 0; 0 0 -k4 k4+k5 -k5 0;-k7 0 -k5 -k5 k5+k6+k7 -k6; 0 0 0 0 -k6 k6];
C=[c1+c2+c7 -c2 0 0 -c7 0; -c2 c2+c3 -c3 0 0 0; 0 -c3 c3+c4 -c4 0 0; 0 0 -c4 c4+c5 -c5 0;-c7 0 -c5 -c5 c5+c6+c7 -c6; 0 0 0 0 -c6 c6];
W = [0.5 0.63 0.8 1 1.25 1.6 2 2.5 3.15 4 5 6.3 8 10 12.5 16 20];
p=zeros(17,1);
x=zeros(17,1);
x1=zeros(17,1);
[rows columns] = size(W);
for i=1:columns % Retriveing number of frquencies
A= (-W(i)^2*M+j*W(i)*C+K);
B=[k1 c1; 0 0; 0 0; 0 0;0 0;0 0];
a = [1.01 1.01 1.01 1.02 1.03 1.06 1.08 1.1 1.16 1.29 1.45 1.23 1.01 0.96 0.86 0.71 0.63]; % Experimental results of seat to head transmissibility.
b1= abs([0 0 0 0 0 1]*inv(A)*B*[1; j*W(i)]); % Analytical calculation of seat to head trasnmissibility.
p(i)= abs(b1);
x(i)= (p(i)- a(i)); % Difference between analytical and experimental STHT values.
x1(i)= (x(i)^2); % square of the Errors.
end
subplot(2,2,1);
plot(W,a,'r');
title('STHT Experimental Results')
subplot(2,2,2);
plot(W,abs(p),'g');
title('STHT Analytical Results')
subplot(2,2,[3,4]);
plot(W,a,'r',W,abs(p),'g');
title('STHT exp and any')
veeresh ghttps://www.mathworks.com/matlabcentral/profile/authors/13238562-veeresh-gtag:www.mathworks.com,2005:Question/4798992019-09-11T11:59:15Z2019-09-16T09:56:49ZHow to use streamline function?I wanted to show the streamline, but failed though the velocity field can be shown.
Would you like to have a look at the attaced files?
Thanks a lot.Jacqueshttps://www.mathworks.com/matlabcentral/profile/authors/1685346-jacquestag:www.mathworks.com,2005:Question/4803202019-09-13T18:42:45Z2019-09-16T09:54:05ZNot Enough Input Arguments when trying to pass two variables as undefinedfunction l = spectrum(t,N)
%parameters
pmax= 1;
phi= 2 * 10^12;
L= 0.67;
a= 1;
k= 1;
Iin= 100;
Kw= 2;
s= 0.017;
zm= 10;
K=1;
function j= photons(x,z)
kbg= K * exp(-s*(x - 484));
I= Iin * exp((-Kw*z) -(kbg*z) -(k*N*z));
j=a*k*I;
end
y = integral (@photons,400,700);
function d = growth (z)
d= pmax * ((y/(pmax/phi)) + y) - L * N;
end
dNdt= (N/zm)* integral(@growth,0,10);
l = dNdt
end
I'm trying to recreate the differential equations in the attached PDF but when I try to use ode45 to solve I'm receiving an error "Not enough input arguments" in line 19 (equation I within function j). If I define either x or z as some value then the code works but I need both x and z to be undefined because I need to integrate over x from 400 to 700 and over z from 0 to 10. I tried defining x and z as elements of an array Y, but that returned "Index exceeds number of array elements (1)" as an error.
I don't think this code is optimized in any way but I'm mainly curious as to how I can get x and z to be accepted as undefined variables in order to eventually integrate over them. Any help or advice would be appreciated!Jake Swansonhttps://www.mathworks.com/matlabcentral/profile/authors/15595493-jake-swansontag:www.mathworks.com,2005:Question/4805732019-09-16T08:52:05Z2019-09-16T09:51:55ZConvolution Computations results for a system response.Can anyone tell the difference of these plots that I used following two codes to plot the results of convolution computations given and need to know the reason for having following difference?
I have attached the results I got for these codes.Prasad Edirisuriya Mudiyanselagehttps://www.mathworks.com/matlabcentral/profile/authors/15986948-prasad-edirisuriya-mudiyanselagetag:www.mathworks.com,2005:Question/4802112019-09-13T04:50:35Z2019-09-16T09:48:32ZFaded color under area of curveIs there a way to fade the color under the area of a curve? For example, in an increasing plot that starts at 1 the area beneath the curve is white and as the curve increases to 100 it becomes a dark blue.
I'm aware of the area(x,y) function, but that just gives me a solid color. Brett Kemmanhttps://www.mathworks.com/matlabcentral/profile/authors/10825993-brett-kemmantag:www.mathworks.com,2005:Question/4799922019-09-11T22:04:03Z2019-09-16T09:43:25Zplot a single Error barsHi all,
I am trying to create one error bar but I am struggling a lot.
I tried to read the matlab documentation about error bars but the site is down for some reason.
Anyway, I have calculate the standard deviaiton (s=4.13) but I am confused witht the x,y axes
the x axis should be 1 value and the y axis has a range from 0 to 14
please let me know what you think
many thanks
NikolasNikolas Spiliopouloshttps://www.mathworks.com/matlabcentral/profile/authors/9122757-nikolas-spiliopoulostag:www.mathworks.com,2005:Question/4805662019-09-16T08:02:23Z2019-09-16T09:39:17ZHow to integrate a function u^3/(exp(u)-1) in the range of [0 0.033]??. The code is as follows:
syms x
fun=x^3/(exp(x)-1)
defIntVal=int(fun,[0 0.033])
I have used integral command also in place of int
the defIntVal is giving a very complex sym type variable. How to get value from this variable???
Raj Kishorhttps://www.mathworks.com/matlabcentral/profile/authors/9409974-raj-kishortag:www.mathworks.com,2005:Question/4647332019-05-30T07:32:33Z2019-09-16T09:38:22Zparpool warning: A task was unexpectedly found in state: Unavailable.The program still works correctly, but I cannot explai the warning
Starting parallel pool (parpool) using the 'local' profile ...
Warning: A task was unexpectedly found in state: Unavailable.
> In parallel.cluster.Local/deriveJobStateFromTasks (line 29)
In parallel.cluster.Local/getJobState (line 179)
In parallel.cluster.CJSCluster/hGetJobState (line 358)
In parallel.internal.cluster.CJSJobMixin/hGetStateEnum (line 144)
In parallel.Job/get.StateEnum (line 238)
In parallel.Job/get.State (line 230)
In parallel.internal.customattr.CustomGetSet>iVectorisedGetHelper (line 128)
In parallel.internal.customattr.CustomGetSet>@(a,b,c)iVectorisedGetHelper(obj,a,b,c) (line 102)
In parallel.internal.customattr.CustomGetSet/doVectorisedGet (line 103)
In parallel.internal.customattr.CustomGetSet/hVectorisedGet (line 76)
In parallel.internal.customattr.GetSetImpl>iAccessProperties (line 322)
In parallel.internal.customattr.GetSetImpl>iGetAllPropertiesVec (line 264)
In parallel.internal.customattr.GetSetImpl.getImpl (line 133)
In parallel.internal.customattr.CustomGetSet>iHetFunGetFunction (line 154)
In parallel.internal.customattr.CustomGetSet>@(o)iHetFunGetFunction(o,props) (line 139)
In parallel.internal.cluster.hetfun (line 46)
In parallel.internal.customattr.CustomGetSet>iHetFunGetProperty (line 139)
In parallel.internal.customattr.CustomGetSet/get (line 38)
In parallel.internal.pool.InteractiveClient/pRemoveOldJobs (line 476)
In parallel.internal.pool.InteractiveClient/start (line 317)
In parallel.Pool>iStartClient (line 796)
In parallel.Pool.hBuildPool (line 585)
In parallel.internal.pool.doParpool (line 18)
In parpool (line 98)
In utils.SERVER (line 5)
Connected to the parallel pool (number of workers: 32).Jean Paulhttps://www.mathworks.com/matlabcentral/profile/authors/55470-jean-paultag:www.mathworks.com,2005:Question/4264842018-10-27T21:59:31Z2019-09-16T09:36:40Z1d Convolution using Matlab's conv() functionAccording to the documentation(https://www.mathworks.com/help/matlab/ref/conv.html),
len(output) = len(input) + len(kernel) - 1
So, I figured out
* In case of |conv(u,v,"full")|:
len(pad) = len(kernel) - 1
For instance, according to Matlab commandline:
u = [1 2 1 3]
v = [2 0 1]
w = [2 4 3 8 1 3]
Coz,
len(w) = len(u) + len(v) - 1
= 4 + 3 - 1
= 6
len(pad) = len(v) - 1
= 3 - 1
= 2
So, according to calculation:
0 0 1 2 1 3 0 0
1 0 2
---------------
0 0 2 = 2
. . . . . .
. . . . . .
0 0 1 2 1 3 0 0
1 0 2
-------------------
3 0 0 = 3
* In case of |conv(u,v,"same")|:
u = [1 2 1 3]
v = [2 0 1]
w = [4 3 8 1]
Coz,
len(w) = len(u)
= 4
len(pad) = floor(len(v) / 2)
= floor(3 / 2)
= 1
So, according to calculation:
0 1 2 1 3 0
1 0 2
-----------
0 0 4 = 4
. . . . . .
. . . . . .
0 1 2 1 3 0
1 0 2
---------------
1 0 0 = 1
But, the problem arises in case of the following example:
u = [1 2 1 3 1]
v = [2 0 1 0]
The following one is okay:
* In case of |conv(u,v,"full")|:
w = [2 4 3 8 3 3 1 0]
len(w) = len(u) + len(v) - 1
= 5 + 4 - 1
= 8
len(pad) = len(v) - 1
= 4 - 1
= 3
So,
0 0 0 1 2 1 3 1 0 0 0
0 1 0 2
---------------------
0 0 0 2 = 2
. . . . .
. . . . .
0 0 0 1 2 1 3 1 0 0 0
0 1 0 2
---------------------------
0 0 0 0 = 0
*But, the following one has issues:*
* In case of |conv(u,v,"same")|:
w = [3 8 3 3 1]
Coz,
len(w) = len(u)
= 5
len(pad) = floor(len(v) / 2)
= floor(4 / 2)
= 2
So, according to calculation:
0 0 1 2 1 3 0 0
0 1 0 2
---------------
0 0 0 4 = 4
0 0 1 2 1 3 0 0
0 1 0 2
---------------
0 1 0 2 = 3
0 0 1 2 1 3 0 0
0 1 0 2
---------------
0 2 0 6 = 8
0 0 1 2 1 3 0 0
0 1 0 2
-----------------
0 1 0 0 = 1
0 0 1 2 1 3 0 0
0 1 0 2
-------------------
0 3 0 0 = 3
I.e. |output = [4 3 8 1 3]| which doesn't match the Matlab output.
*What is going on here?*Ba Ba Black Sheep!https://www.mathworks.com/matlabcentral/profile/authors/9127231-ba-ba-black-sheeptag:www.mathworks.com,2005:Question/4805762019-09-16T09:29:39Z2019-09-16T09:29:39ZDeep learning generated Holographydo any anyone know about generating hologram using deep learning?Aamir Khanhttps://www.mathworks.com/matlabcentral/profile/authors/6311741-aamir-khantag:www.mathworks.com,2005:Question/4801632019-09-12T19:33:38Z2019-09-16T09:26:42ZIs this a right process flow of stft and spectrogramHi experts,
I am very new in digital signal processing, and thus in fourier transform. I spent last couple of days grasping the concept of FT, FFT, DFT, and STFT. I have created a flow chart showing the steps of getting spectrogram using STFT. Could you please take a look at the attached image and tell me if I misunderstood anything, or used any term incorrectly. I know this question is not directly related to Matlab, however, any suggestion will be highly appriciated. Thank you!!
Khandakar Rashidhttps://www.mathworks.com/matlabcentral/profile/authors/12159582-khandakar-rashidtag:www.mathworks.com,2005:Question/4805752019-09-16T09:21:23Z2019-09-16T09:21:23ZPixel labeling for Training RCNN detectorHi Guys
Just asking Is it possible to make Pixel labeling by groundTruth for RCNN DetectorAbdussalam Elhanashihttps://www.mathworks.com/matlabcentral/profile/authors/15843739-abdussalam-elhanashitag:www.mathworks.com,2005:Question/1841862015-03-20T13:42:41Z2019-09-16T09:19:15ZWhy doesn't audiowrite write metadata (title, etc) to wav file?I want to save information about wav file in wave file properties field. When I try to use 'Title, string' Name-Value pair, the string does not show up in title field of wav file.
What am I doing wrong?Danhttps://www.mathworks.com/matlabcentral/profile/authors/1457182-dantag:www.mathworks.com,2005:Question/4805742019-09-16T09:10:57Z2019-09-16T09:10:57ZSolve equations with constraints Can you help me solve equation f with the different constraints established?
I can't get the optimal solution:
syms A k q c k;
beta= sym('beta');
q=(A+beta*k)/3;
c=(A+beta*k)/3;
k=(2*A*beta)/(9-2*beta^2);
f= A*q+beta*q*k-q^2-c*q- k^2/2;
solve(f)
if f>=0
if c>=0
if q>=0
if beta >0
if beta-1<=0
if A>0
end
end
end
end
end
end ;
King regardsZongo Amara Mohamed Isaachttps://www.mathworks.com/matlabcentral/profile/authors/14670727-zongo-amara-mohamed-isaactag:www.mathworks.com,2005:Question/4804612019-09-15T13:55:45Z2019-09-16T09:10:42ZFind the problem with my FFT codeHello
I'm using FFT code to compare the amplitudes of two signals, but the answer is different from my idea.
I measured the pressure signal 1000 times a second.
And one is unchanged, the other is increasing.
I divided these two signals by 8 seconds each and PLOT through FFT.
If I find the amplitude with the code below, the value of the unchanging signal is bigger.
But in my opinion, the amplitude of the magnitude of the increasing signal should be bigger den unchanged signal.
Is my code wrong?
thank you for reading :)
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sample time
L = 8000; % Length of signal
t = (0:L-1)*T; % Time vector
x=TL26; %signal
y=table2array(x);
n=4; %% order of Butterworth filter
Wn=[130 150]; % 130 ~ 150Hz signal
Fn=Fs/2; % Nyquist
ftype='bandpass';
[b,a]=butter(n, Wn/Fn, ftype);%%% butter(): ë²„í„°ì›ŒìŠ¤ returns an order 2*n digital bandpass filter if
%%%fbn is a two-element vector
e=filtfilt(b,a,y);
N = length(e);
NFFT = 2^nextpow2(N); % Next power of 2 from length of y
%Y = fft(y,NFFT)/NFFT;
Y = fft(e,NFFT);
Ya = abs(Y)/NFFT; % correctly normalised amplitude
f = Fs/2*linspace(0,1,NFFT/2+1);
% Plot single-sided amplitude spectrum.
figure(99)
plot(f,2*abs(Ya(1:NFFT/2+1)));
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')dongwoo kimhttps://www.mathworks.com/matlabcentral/profile/authors/15433021-dongwoo-kimtag:www.mathworks.com,2005:Question/4801022019-09-12T14:38:31Z2019-09-16T09:07:09ZRegexp lookbehind and lineanchorsCould someone help me to understand why
st = ' a b c';
pattern = '(?<=^\s*)c';
regexp(st,pattern,'lineanchors')
ans =
[]
i.e., does not match (as I expected), while
st2 = [newline,st];
regexp(st2,pattern,'lineanchors')
ans =
7
i.e., finds a match?
My intent is to match 'c' that is preceded by the beginning of a line and zero or more white character. How should I do?alelap83https://www.mathworks.com/matlabcentral/profile/authors/16185656-alelap83tag:www.mathworks.com,2005:Question/4800522019-09-12T09:39:31Z2019-09-16T09:03:20ZLicence Manager Error - 9Hi, I recently installed MATLAB in my pc with windows. I received this error called "Licence Manager Error - 9" immediately after the installation. I found that the username I've entered for the installation is different from my actual pc username called "Administrator". So, do I need to reinstall the whole program or what should I do?
Thanks in advance!Prince Rajhttps://www.mathworks.com/matlabcentral/profile/authors/16142152-prince-rajtag:www.mathworks.com,2005:Question/4805712019-09-16T08:39:16Z2019-09-16T08:57:54ZGetting timing closure for HDL Coder IP with multicycle pathsI have created an IP component with HDL Coder and I have integrated this into a Vivado project but I am struggling to get timing closure using multicycle paths.
The FPGA clock rate is set at 50MHz. The IP block carries out some reasonably complex fixed point computations at a slower rate of 250KHz. There are 200 clock cycles to complete these computations. Within the computations there are some 1/Z feedback loops as the calculations for the current cycle depend on the results from the previous cycle. There is also some trivial logic that runs in a single cycle at the 50MHz rate. So, the IP model block has 2 rates; 50MHz and 250KHz. Also, some of the slower rate computations are pipelined on 4 paths so in the HDL Coder generated model there are rates of 50MHz, 250KHz and 1MHz as a result of the pipelining. I have surrounded the slower functionality with 1/Z delays as suggested in the help for multicycle paths.
When I generate the IP block I get a timing controller file _tc.vhd with clock enables at 50 and 200 times slower than the base FPGA clock rate.
-- enb_1_1_1 : identical to clk_enable
-- enb_1_50_0 : 50x slower than clk with last phase
-- enb_1_200_0 : 200x slower than clk with last phase
-- enb_1_200_1 : 200x slower than clk with phase 1
--
ATTRIBUTE keep OF phase_0 : SIGNAL IS "true";
ATTRIBUTE mcp_info OF phase_0 : SIGNAL IS "SpeedsVibsProc_tc.u1_d50_o0";
ATTRIBUTE keep OF phase_0_1 : SIGNAL IS "true";
ATTRIBUTE mcp_info OF phase_0_1 : SIGNAL IS "SpeedsVibsProc_tc.u1_d200_o0";
I also generate a multicycle constraints file as follows:
# Multicycle constraints for clock enable: SpeedsVibsProc_tc.u1_d50_o0
set enbregcell [get_cells -hier -filter {mcp_info=="SpeedsVibsProc_tc.u1_d50_o0"}]
set enbregnet [get_nets -of_objects [get_pins -of_objects $enbregcell -filter {DIRECTION == OUT}]]
set reglist [get_cells -of [filter [all_fanout -flat -endpoints_only $enbregnet] IS_ENABLE]]
set_multicycle_path 50 -setup -from $reglist -to $reglist -quiet
set_multicycle_path 49 -hold -from $reglist -to $reglist -quiet
# Multicycle constraints for clock enable: SpeedsVibsProc_tc.u1_d200_o0
set enbregcell [get_cells -hier -filter {mcp_info=="SpeedsVibsProc_tc.u1_d200_o0"}]
set enbregnet [get_nets -of_objects [get_pins -of_objects $enbregcell -filter {DIRECTION == OUT}]]
set reglist [get_cells -of [filter [all_fanout -flat -endpoints_only $enbregnet] IS_ENABLE]]
set_multicycle_path 200 -setup -from $reglist -to $reglist -quiet
set_multicycle_path 199 -hold -from $reglist -to $reglist -quiet
I then build the IP block into a Vivado project and build the design; also adding the muticycle constraints file to the project. However, the design fails to meet the timing constraints with some paths with a WNS of around -66ns.
I have manually entered the commands from the constraints file in the TCL command window and all seems fine; no errors or warnings.
If I open up one of the failing paths and look at the schematic I see a very long set of linked blocks and it seems that these are somehow related to the 1/Z feedbacks within the calculations.
Is there anything I can do the model design to make the timing closure easier? Do I need to manually create a different multicycle paths constraints file for example?Mike Bardillhttps://www.mathworks.com/matlabcentral/profile/authors/841081-mike-bardilltag:www.mathworks.com,2005:Question/4803172019-09-13T18:21:42Z2019-09-16T08:48:40ZNon-linear simulink function block help.So I have my actual matlab file working perfectly, however, I need to transfer this to a simulink file that takes input x(t) and returns output phi(t). Just in standard input, process, output format. Only problem is I've never used simulink, and ive got no Idea where to start with this. The code I used is shown bellow:
%System Constants
L1 = 20;
L1A = 10;
L1B = 10;
L2 = 50;
H= 0.47;
%System Initial Physical Parameters
lambda1p = 2;
lambda2p = 2;
lambda3p = 1/(lambda1p*lambda2p);
%System Physical Constants
M = 17.5; %Mass of the mass (g)
c = 0.696; %Damping Co-efficient
mu = 562.01; %Small Strain shear modulus (kPa)
epsilon = 2.39e-11; %Di-electric Permitivity (F/m)
roe = 1522;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Mathematical Data%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Input Waveform Charecteristics
A = 0.011; %Desired Peak Amplitude (mm)
T = 20; %Waveform Period (S)
f = 1/T; %Frequency (Hz) of Waveform
%Symbolic Equations
syms t
%x = @(t)A*sin(2*pi*f*t); %Sinusoidal Input Trajectory
%x = @(t)(2*A/pi)*asin((sin(2*pi*f*t))); %Triangular Input Trajectory
x = @(t)((((heaviside(t-1)+heaviside(9-t))/2)+((heaviside(t-3)+heaviside(6-t))/2))-1)*A; %Stair Input Trajectory
lambda1A = @(t)((L1A*lambda1p)+x(t))/L1A; %Stretch Factor 1A eqn
lambda1B = @(t)((2*lambda2p)-lambda1A(t)); %Stretch Factor 1B eqn
lambda1Adot=symfun(diff(lambda1A(t)),t); %1st Differential of Stretch Factor 1A (array)
lambda1Adot_t=@(t) eval(lambda1Adot); %1st Differential of Stretch Factor 1A (function)
lambda1Bdot=symfun(diff(lambda1B(t)),t); %1st Differential of Stretch Factor 1B (array)
lambda1Bdot_t=@(t) eval(lambda1Bdot); %1st Differential of Stretch Factor 1B (function)
lambda1A2dot=symfun(diff(diff(lambda1Adot(t)),t),t); %2nd Differential of Stretch Factor 1A (array)
lambda1A2dot_t=@(t) eval(lambda1A2dot); %2nd Differential of Stretch Factor 1A (function)
lambda1B2dot=symfun(diff(diff(lambda1Bdot(t)),t),t); %2nd Differential of Stretch Factor 1B (array)
lambda1B2dot_t=@(t) eval(lambda1B2dot); %2nd Differential of Stretch Factor 1B (function)
%Timebase
t = [0.01:0.1:9.99];
%Numerical Arrays
x = x(t); %Store Numerical results of function for given t
lambda1A = lambda1A(t); %Store Numerical results of function for given t
lambda1B = lambda1B(t); %Store Numerical results of function for given t
lambda1Adot_t=lambda1Adot_t(t); %Store Numerical results of function for given t
lambda1Bdot_t=lambda1Bdot_t(t); %Store Numerical results of function for given t
lambda1A2dot_t=lambda1A2dot_t(t); %Store Numerical results of function for given t
lambda1B2dot_t=lambda1B2dot_t(t); %Store Numerical results of function for given t
%%%%%%%%%%%%%%%%%%%%%%%%%%%Charecteristic Equation%%%%%%%%%%%%%%%%%%%%%%%%%
Phi = (((L1A*H)./(L2*epsilon*(lambda2p^2)*lambda1A)).*((M.*lambda1A2dot_t)+(c.*lambda1Adot_t)-(((mu*L2*H)./L1A).*((2*lambda1p)-(2*lambda1A)-((((2*lambda1p)-(lambda1A)).^-3)*(lambda2p^-2))+((lambda1A.^-3)*(lambda2p^-2)))))).^0.5;Mark Dawsonhttps://www.mathworks.com/matlabcentral/profile/authors/11959330-mark-dawsontag:www.mathworks.com,2005:Question/4802322019-09-13T08:57:06Z2019-09-16T08:45:08ZTutorials for machine learning, e.g. predict future energy useHi Matlab-buddies,
I wonder if there are any tutorials availabe, including a given dataset, for using machine learning & deep learning in Matlab? This can be prediction of future energy use based on historic energy data together with outdoor temperature (energy use correlates with outdoor temperature). Or, do I need to sign up for a Matlab course online? I have found very short examples of showing the use of Machine learning but nothing detailed-enough that shows me the practical working procedure.
Thank you!
Kind regards, VlatkoVlatko Milichttps://www.mathworks.com/matlabcentral/profile/authors/11257040-vlatko-milictag:www.mathworks.com,2005:Question/4805722019-09-16T08:44:52Z2019-09-16T08:44:52ZAutogenerated Codefrom Response optimization does not runHello, #
I have generated from the Response Optimization toolbox a Matlab Code.
This code cant be run since a function evalRequirement is giving me an error. The optimization is working with the user Interface.
My Lincense Code: 40714293
Error using sdo.optimize (line 114)
The function handle passed to the optimize command encountered an error when evaluated with a parameter vector.
Error in sdo_SimulinkModelxxx (line 96)
[Optimized_DesignVars,Info] = sdo.optimize(optimfcn,DesignVars,Options);
Caused by:
Undefined function 'evalRequirement' for input arguments of type 'timeseries'.
Mayuvarunaan Kanesamoorthyhttps://www.mathworks.com/matlabcentral/profile/authors/14451639-mayuvarunaan-kanesamoorthytag:www.mathworks.com,2005:Question/4802162019-09-13T05:53:53Z2019-09-16T08:44:28ZHuge matrix with NchoosekI got my answer
ThanksHamad Gulhttps://www.mathworks.com/matlabcentral/profile/authors/14084565-hamad-gultag:www.mathworks.com,2005:Question/4444692019-02-12T06:02:40Z2019-09-16T08:39:26ZI want to add two pulse generator in simulink and dump it into arduino uno...the result i am getting is change in the frequency at arduino output what i have set in pulse generator?
i want to generate 0.02 (50 hz) time period pulse by adding this two pulse generator, i am getting the output from the arduino but frequncy is not 50 hz, kindly suggest
this is the pulse i want to generate at arduino output for 0.02 time period.
Aniket Manjarehttps://www.mathworks.com/matlabcentral/profile/authors/12110619-aniket-manjaretag:www.mathworks.com,2005:Question/4800952019-09-12T14:02:35Z2019-09-16T08:37:19ZAudiowrite function is not saving the title or artist informationI use this code to save an audio file:
audiowrite('Audio1.wav', [left1, right1], fs, 'Title', 'My Title', 'Artist', 'My Name');
However, the title and artist metadata is never saved:
I am running Matlab 2019a and Windows 10.Peter Svendsenhttps://www.mathworks.com/matlabcentral/profile/authors/14629115-peter-svendsen