https://de.mathworks.com/matlabcentral/answers/questions.atomMATLAB Answers — New Questions2019-02-16T18:43:33Ztag:de.mathworks.com,2005:Question/2459062015-09-30T01:34:09Z2019-02-16T18:43:33ZHow can I use the Information Gain with features? in order to select good featureHi everyone,
I have been obtained features from EEG signals by using the Discrete Wavelet Transform (DWT) as Alpha, Beta, Delta and Theta.
Now, I want to select the best band from 4 bands by using Information Gain method.
Excuse me, could you please help me to get the best one.
Note: any help it's will appreciate.
Yours Sincerely,
HadiHadi AlGhayabhttps://de.mathworks.com/matlabcentral/profile/authors/7023327-hadi-alghayabtag:de.mathworks.com,2005:Question/4453122019-02-16T15:59:30Z2019-02-16T18:43:05ZMATLAB crashing when plotting with AMD driverseven after updating the drivers MATLAB is crashing.
pvr murthyhttps://de.mathworks.com/matlabcentral/profile/authors/14745717-pvr-murthytag:de.mathworks.com,2005:Question/4451182019-02-15T09:31:39Z2019-02-16T18:41:58ZExtracting Frames and resizing each frameHy, i convert YUV video file to frames but now i want to change size of every frames , how can i do that?
My code is:
clc; clear; close all;
VideoSequence = 'sampleQCIF.yuv';
width = 176;
height = 144;
nframes = 300;
[Y,U,V] = yuvRead(VideoSequence, width, height, nframes);
figure;
c = 0; % counter
for iFrame = 1:10
c = c + 1;
subplot(4,5,c),
imshow(Y(:,:,iFrame));
title(['frame #', num2str(iFrame)]);
endIqra Saleemhttps://de.mathworks.com/matlabcentral/profile/authors/11869957-iqra-saleemtag:de.mathworks.com,2005:Question/4452902019-02-16T11:21:48Z2019-02-16T18:40:37Zwhat does the L-shaped bracket mean?
N1 = N2 = 4
xi = ith pixel of 4 x 4 block
What does the 'L - shaped bracket' mean? How to write code for alpha and beta with conditions specified below summmation symbol? Elysi Cochinhttps://de.mathworks.com/matlabcentral/profile/authors/3625227-elysi-cochintag:de.mathworks.com,2005:Question/4453132019-02-16T16:19:42Z2019-02-16T18:38:54ZBathymetric data into a surface plotHi,
I have attached a folder which is my given bathymetric data for a seabed. I want to make this into a surface plot or a contour map. I am new to matlab and have little experience with the software, but understand that it is a good software for this particular problem.
If anyone could assit me with this, that would be great.
Thankyou,
Ruari SkinnerRuari Skinnerhttps://de.mathworks.com/matlabcentral/profile/authors/14799330-ruari-skinnertag:de.mathworks.com,2005:Question/4452492019-02-16T01:33:58Z2019-02-16T18:38:41ZDICOM Image Resize ErrorHi,there. I'm new to matlab and programming.
Since resizing is needed for Alexnet and Googlenet, I`m now working on resizing Dicom File from 256*256*1 to 227*227*3.
Here is my directory:
main
-- a
-- image.dcm(10 dicom file)
-- b
-- image.dcm(10 dicom file)
-- c
-- image.dcm(10 dicom file)
-- d
-- image.dcm(10 dicom file).
Here is my code:
%path = current directory
currentdirectory = pwd;
%% Create an ImageDatastore to help you manage the data.currentdirectory = pwd;
categories = {'a', 'b', 'c','d'};
%Because ImageDatastore operates on image file locations,
imds = imageDatastore(fullfile(currentdirectory, categories),'IncludeSubfolders',true,'FileExtensions','.dcm','LabelSource', 'foldernames','ReadFcn',@dicomread);
%resize
imdsResized = imresize3(imds, [227 227 3]);
However, it throws following error:
Error using imresize3
Expected input number 1, V, to be one of these types:
single, double, int8, int16, int32, uint8, uint16, uint32
Instead its type was matlab.io.datastore.ImageDatastore.
Anyone have answer about this situation, pls let me know.
Thanks in advance!sskhttps://de.mathworks.com/matlabcentral/profile/authors/14545678-ssktag:de.mathworks.com,2005:Question/2490382015-10-16T18:59:11Z2019-02-16T18:34:07ZDrawing a star with n pointsHi guys I have this question to do but I have no clue for any of it.
First write a function file star.m with first line
function turtle=star(turtle,npoints,R,r)
which uses turtle to draw a star centred at the turtle’s current location. Inputs:
• turtle: an initialized turtle to draw the star with;
• npoints: the number of points the star;
• R: distance from the centre of the star to the points;
• r: distance from the centre to the inward corners between the points.
Output turtle: turtle used for drawing in its new state.
One point of the star should point in the initial direction of the turtle.
Thanks help would be appreciated.James Connorhttps://de.mathworks.com/matlabcentral/profile/authors/7128519-james-connortag:de.mathworks.com,2005:Question/4453252019-02-16T18:14:15Z2019-02-16T18:32:57ZMatrix element changing with loopI keep getting Dimensions of matrices being concatenated are not consistent error.
for k=1:61
a(:,k)=angle(k,:);
A=[cosd(5) -sind(a); -sind(5) cosd(a)];
x=A\B;
end
I don't get what I am doing wrongRamitha Herathhttps://de.mathworks.com/matlabcentral/profile/authors/11890683-ramitha-herathtag:de.mathworks.com,2005:Question/337792012-03-28T18:11:32Z2019-02-16T18:28:39ZZooming a portion of figure in a figure.Dear friends
Can any boby will tell the method of zooming only a portion of a particular figure, in figure window. This is mainly required to indicate the detail of a particular segment of a figure.
Please reply...
Arifhttps://de.mathworks.com/matlabcentral/profile/authors/1231309-ariftag:de.mathworks.com,2005:Question/4447742019-02-13T15:05:17Z2019-02-16T18:12:54ZI would like to add a 'display-all' hyperlink functionality to a class.I've created a series of classes which serve as a convienient front end for some standard data sources which are ubiquitous in our organization.
I've been storing the data in a structure [in it's native form] and I've created alot of dependent properties to access the data convieniently. In addition, many of these dependent properties do alot of indexing in and [sometimes time consuming] calculations to identify good/bad/ugly regions and other things.... stuff which I want to only see sometimes.
I've tried hiding some properties, but it's easy to forget what they are and it's harder to hand off data to someone who maybe isn't as intimate with the source.
Currently, I've defined some custom display routines so not all of the data is displayed when something is queried in the command line. I can over-ride the custom display and use MATLAB's builtin display routines when I need to.
What would be very helpful is to add a hyperlink (like the display for graphic handle objects below) to quickly display various subsets (or groups of properites) of my data.
I haven't figured out how to get a hyperlink reference to a specific instance of my class... it appears to only have access to the base workspace.... Any thoughts?
K>> foo = figure
foo =
Figure (3) with properties:
Number: 3
Name: ''
Color: [1×3 double]
Position: [680 678 560 420]
Units: 'pixels'
Show all properties
classdef foo < matlab.mixin.CustomDisplay
properties
this = 1;
that = 2;
theother = 'harbinger to lots of other properties';
end
methods (Access = protected)
function g = getPropertyGroups(obj)
g = matlab.mixin.util.PropertyGroup({'this','that'},'important stuff:');
end
function f = getFooter(obj)
f = sprintf('<a href = "??matlab: CAN-ONLY-ACCESS-BASE-SPACE-FROM-HERE??" >display all</a>');
end
end
end
Stevehttps://de.mathworks.com/matlabcentral/profile/authors/1471355-stevetag:de.mathworks.com,2005:Question/4453242019-02-16T18:07:14Z2019-02-16T18:07:14ZRuning matlab in terminalHi,
Im trying to run matlab in terminal by this command:
matlab -nodisplay -nosplash -nodesktop
but it opens a new window and runs matlab:
How can i open matlab in terminal itself? without opening new window?Daniyal Marofihttps://de.mathworks.com/matlabcentral/profile/authors/14799801-daniyal-marofitag:de.mathworks.com,2005:Question/4453232019-02-16T18:07:06Z2019-02-16T18:07:06ZPearson correlation display one numberHow do I display one single number for the Pearson correlation?
Below is the part of the code I use to generate the correlation coefficient. Is there a way to define the dimensions and avoid getting four numbers?
PearsonA1A230=corrcoef(Absorbance30_1,Absorbance30_2)
Chanaka Navarathnahttps://de.mathworks.com/matlabcentral/profile/authors/14638173-chanaka-navarathnatag:de.mathworks.com,2005:Question/4452652019-02-16T06:18:41Z2019-02-16T18:04:47ZUpside down display of graphi am currently using Matlab r2015a in ubuntu 18.04.graph window is being displayed upside down .how to fix it?
here's my code:
>> x = [4 5 6];
>> y = sin(x);
>> plot (x,y)
And the displayMUHAMMAD BILALhttps://de.mathworks.com/matlabcentral/profile/authors/13446228-muhammad-bilaltag:de.mathworks.com,2005:Question/4453042019-02-16T14:26:02Z2019-02-16T18:00:21ZHow can I speed up my program ?I am working with R2014b. whenever using cell array in my codes, it takes too much of the time to get the output. how to speed up my code ?Zara Khanhttps://de.mathworks.com/matlabcentral/profile/authors/10893209-zara-khantag:de.mathworks.com,2005:Question/4453082019-02-16T15:27:29Z2019-02-16T17:57:37ZSlider Code problem with axesthis an example of a slider to control movement on axes
a = get (handles.slider2,'Value')
x = 0:0.1:50;
y = sin (x*a);
plot (handles.axes1,x,y)
and this me trying to apply the example
function slider2_Callback(hObject, eventdata, handles)
% hObject handle to slider2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
clc;
load ('100m.mat')
a = get(handles.slider2,'Value');
x = 0:0.1:50;
ECGsignal = (val - 1024 )/200;
y = ECGsignal*x*a;
plot (handles.axes1,x,y)
what is the problem in my code ?Hassan Boshahttps://de.mathworks.com/matlabcentral/profile/authors/14798685-hassan-boshatag:de.mathworks.com,2005:Question/4453212019-02-16T17:55:50Z2019-02-16T17:55:50ZHow to apply dijkstra's algorithm by inputting 3D nodes?Hello, Everyone!
I am trying to find the shortest path by using dijkstra's algorithm and I need to input 3-Dimensional nodes into the program.
Each 3-Dimensional nodes have x, y, z coordinates. I am trying to use Nx3 matrix to represent it or maybe Nx4 matrix include the node ID.
I found that there is a function which called graphshortestpath in matlab function.
I want to know that is it possible to input 3-Dimensional nodes and plot a graph to demonstrate the result?
If yes, please tell me how to do it or give me some examples. If the function cannot do it, please tell me how to do it by other methods.
Thank you very much!Antonio Smithhttps://de.mathworks.com/matlabcentral/profile/authors/14787536-antonio-smithtag:de.mathworks.com,2005:Question/4453202019-02-16T17:42:30Z2019-02-16T17:47:51ZConstants optimization for multiple regression with multiple variationsI have the example data as show in bellow,
x1 = [288 298 308 318 328 338 283 293 303 313 323 333 283 293 303 313 323 333];
x2 = [17.42 17.4217.42 17.42 17.42 17.42 17.95 17.95 17.95 17.95 17.95 17.95 17.13 17.13 17.13 17.13 17.13 17.13];
x3 = [1.2111 1.2111 1.2111 1.2111 1.2111 1.2111 1.2684 1.2684 1.2684 1.2684 1.2684 1.2684 0.6207 0.6207 0.6207 0.6207 0.6207 0.6207];
y = [6.785 6.777 6.770 6.762 6.754 6.746 6.793 6.785 6.777 6.768 6.760 6.751 6.786 6.777 6.769 6.760 6.752 6.743];
and, I have the equation for predicting as show in the following,
y = a + bx2 + cx3 + (d + e*x2 + f*x3) / x1) ....(1)
where, a, b, c, d, e, and f are the constant.
How to write the code in matlab for optimizing the constants of Eq. (1)?Thinnaphop Chum-inhttps://de.mathworks.com/matlabcentral/profile/authors/14799639-thinnaphop-chum-intag:de.mathworks.com,2005:Question/4453192019-02-16T17:37:37Z2019-02-16T17:37:37ZI want to design a model of PMSG in large scale wind energy conversion systemCan i get large scale wind energy conversion system from file of exchange?hani abdelraheemhttps://de.mathworks.com/matlabcentral/profile/authors/9482699-hani-abdelraheemtag:de.mathworks.com,2005:Question/4453182019-02-16T17:27:29Z2019-02-16T17:27:29ZStep Fucntion in MatlabI am new to matlab and I have to plot this step fucntion but I don't even know where to start.
x(t) = u(t + 1) − 3u(t) + 2u(t−3) with a time interval of -2: 0.1: 2. May I please get some help?Reindorf Addohttps://de.mathworks.com/matlabcentral/profile/authors/10947678-reindorf-addotag:de.mathworks.com,2005:Question/4452972019-02-16T12:57:38Z2019-02-16T17:27:10ZHow to open two files instead of one, using this "for" loop?Hi,
My current "for" loop opens one file only and writes three lines in it using permurations, for c, s and t.
I need to modify this code to make it ONLY read the values in "s", since the values in "c" and "t" are always zeros. Also, I need to make the loop opens a second file and record each "j".
For example: The first printed file will have:
0 1 0
0 2 0
0 3 0
0 4 0
0 5 0
The second file will have: set case 1, set case 2, set case 3, set case 4, set case 5.
I tried to modify the code, but it does not seem to be working.
close all; clc; clear all;
c= [0 0 0 0 0];
s = [1 2 3 4 5];
t= [0 0 0 0 0];
for i=1:5;
for= j=1:5;
for m=1:5;
line1 =['' num2str(c(i)) ';'];
line2 =['' num2str(s(j)) ';'];
line3 =['' num2str(t(m)) ';'];
fid= fopen('Pulse.tcl','w'); % First file
fprintf(fid,'%s\n',line1);
fprintf(fid,'%s\n',line2);
fprintf(fid,'%s\n',line3);
fid=fclose('all');
line1=['set case 'numer2str(j)',''];
fid=fopen('Case.tcl','w'); % Second file
fprintf(fid,'%s\n',line3);
fid=fclose('all');
end
end
endIsmail Qeshtahttps://de.mathworks.com/matlabcentral/profile/authors/10292327-ismail-qeshtatag:de.mathworks.com,2005:Question/4453172019-02-16T17:20:42Z2019-02-16T17:20:42ZHow can you automate a fem mesh convergent test in Matlab? Is there a pre-build function available within Matlab?Hi everyone,
i want to automate mesh refinment in Matlab for a structial mechanical problem. It's a basic 3D Shape. I would like to refine till i am in a specific tolerance.
Kind regardsTobias Stachhttps://de.mathworks.com/matlabcentral/profile/authors/7592478-tobias-stachtag:de.mathworks.com,2005:Question/4448202019-02-13T18:56:50Z2019-02-16T17:12:33ZHow could i displace the values of X axis under X axis (Y negative) ?+Oreste Russohttps://de.mathworks.com/matlabcentral/profile/authors/14778562-oreste-russotag:de.mathworks.com,2005:Question/4453092019-02-16T15:30:59Z2019-02-16T16:54:48ZWhen I run the program inaccurate results appear What is the problem?syms t y1 y2 y3 y4 yn11 yn1 yr yr11 yr111 yr v y(v) x
format longe
h=0.1
r=1.7686999343761197980595002942562 %1694/911=1.859495060373216e+00
x=0
y0=0
y01=0.25;
y011=0;
fn=-y01+y0.*y01.*y011
fnr=-yr11+yr.*yr11.*yr111
fn1=-yn1+y1.*yn1.*yn11
fn2=-y3+y2.*y3.*y4
eq1 =-y2-(r - 2)/r*y0+ 2/(r*(r - 1))*yr+ (2*r - 4)/(r - 1)*y1 -(h.^3.*(r^4 - 8*r^3 + 22*r^2 - 23*r + 6))/(120*r)*fn+ (h.^3.*(- r^2 + 2*r + 3))/(60*r)*fnr -(h.^3.*(- r^3 + 4*r^2 + 9*r - 26))/60*fn1+ (h.^3.*(- r^3 + 2*r + 1))/120*fn2
eq2= -h.*y3 -(r - 3)/r*y0+ 3/(r*(r - 1))*yr+ (r - 4)/(r - 1)*y1 -(h.^3.*(3*r^4 - 24*r^3 + 66*r^2 - 67*r + 12))/(240*r)*fn -(h.^3.*(r^4 - 5*r^3 + 5*r^2 + 5*r - 4))/(40*r*(r^2 - 3*r + 2))*fnr -(h.^3.*(- 3*r^4 + 15*r^3 + 15*r^2 - 137*r + 116))/(120*(r - 1))*fn1+ (h.^3.*(- r^4 + 2*r^3 + 2*r^2 + 3*r - 12))/(80*(r - 2))*fn2
eq3=-h.^2.*y4+2/r*y0+ 2/(r*(r - 1))*yr -2/(r - 1)*y1+ (h.^3.*(- r^4 + 8*r^3 - 22*r^2 + 18*r + 5))/(120*r)*fn -(h.^3.*(r^4 - 5*r^3 + 5*r^2 + 5*r + 5))/(60*r*(r^2 - 3*r + 2))*fnr -(h.^3.*(- r^4 + 5*r^3 + 5*r^2 - 75*r + 77))/(60*(r - 1))*fn1+ (h.^3.*(- r^4 + 2*r^3 + 2*r^2 + 42*r - 81))/(120*(r - 2))*fn2
eq4=-h.*yn1 -(r - 1)/r*y0+ 1/(r*(r - 1))*yr+ (r - 2)/(r - 1)*y1 -(h.^3.*(r^4 - 8*r^3 + 22*r^2 - 21*r + 6))/(240*r)*fn+ (h.^3.*(- r^2 + 2*r + 3))/(120*r)*fnr -(h.^3.*(- r^3 + 4*r^2 + 9*r - 8))/120*fn1 -(h.^3.*(r^3 - 2*r + 1))/240*fn2
eq5=-h.^2.*yn11+ 2/r*y0+ 2/(r*(r - 1))*yr -2/(r - 1)*y1 -(h.^3.*(r^4 - 8*r^3 + 22*r^2 - 28*r + 10))/(120*r)*fn -(h.^3.*(r^4 - 5*r^3 + 5*r^2 + 5*r - 10))/(60*r*(r^2 - 3*r + 2))*fnr -(h.^3.*(- r^4 + 5*r^3 + 5*r^2 - 35*r + 22))/(60*(r - 1))*fn1+ (h.^3.*(- r^4 + 2*r^3 + 2*r^2 - 8*r + 4))/(120*(r - 2))*fn2
eq6=-h.*yr11+ (r - 1)/r*y0+ (2*r - 1)/(r*(r - 1))*yr -r/(r - 1)*y1+ (h.^3.*(2*r^4 - 13*r^3 + 28*r^2 - 22*r + 5))/240*fn+ (h.^3.*(4*r^3 - 15*r^2 + 10*r + 5))/(120*(r - 2))*fnr+ (h.^3.*r*(- 2*r^3 + 7*r^2 + 2*r - 3))/120*fn1+ (h.^3.*r*(2*r^4 - 5*r^3 + 2*r^2 + 2*r - 1))/(240*(r - 2))*fn2
eq7=-h.^2.*yr111+ 2/r*y0+ 2/(r*(r - 1))*yr -2/(r - 1)*y1+ (h.^3.*(4*r^4 - 22*r^3 + 38*r^2 - 22*r + 5))/(120*r)*fn -(h.^3.*(- 14*r^4 + 55*r^3 - 55*r^2 + 5*r + 5))/(60*r*(r^2 - 3*r + 2))*fnr -(h.^3.*(4*r^4 - 15*r^3 + 5*r^2 + 5*r - 3))/(60*(r - 1))*fn1+ (h.^3.*(4*r^4 - 8*r^3 + 2*r^2 + 2*r - 1))/(120*(r - 2))*fn2
eq8=-h.*y01 -(r + 1)/r*y0 -1/(r*(r - 1))*yr+ r/(r - 1)*y1+ (h.^3.*(r^3 - 8*r^2 + 22*r - 5))/240*fn+ (h.^3.*(r^3 - 5*r^2 + 5*r + 5))/(120*(r^2 - 3*r + 2))*fnr+ (h.^3.*r*(- r^3 + 5*r^2 + 5*r - 3))/(120*(r - 1))*fn1 -(h.^3.*r*(- r^3 + 2*r^2 + 2*r - 1))/(240*(r - 2))*fn2
eq9 =-h.^2.*y011+ 2/r*y0+ 2/(r*(r - 1))*yr -2/(r - 1)*y1 -(h.^3.*(r^4 - 8*r^3 + 22*r^2 + 22*r - 5))/(120*r)*fn -(h.^3.*(r^4 - 5*r^3 + 5*r^2 + 5*r + 5))/(60*r*(r^2 - 3*r + 2))*fnr -(h.^3.*(- r^4 + 5*r^3 + 5*r^2 + 5*r - 3))/(60*(r - 1))*fn1+ (h.^3.*(- r^4 + 2*r^3 + 2*r^2 + 2*r - 1))/(120*(r - 2))*fn2
[y1,y2,y3,y4,yn1,yn11,yr,yr11,yr111]=vpasolve([eq1,eq2,eq3,eq4,eq5,eq6,eq7,eq8,eq9])sadeem alqarnihttps://de.mathworks.com/matlabcentral/profile/authors/12452026-sadeem-alqarnitag:de.mathworks.com,2005:Question/4453162019-02-16T16:43:34Z2019-02-16T16:53:04ZHow can I type inverse sign in axis labels? like 1/CLOreste Russohttps://de.mathworks.com/matlabcentral/profile/authors/14778562-oreste-russotag:de.mathworks.com,2005:Question/4447092019-02-13T10:10:24Z2019-02-16T16:46:55ZHow to get FFT coefficient plot
How to obtain FFT for the given amplitude (vs) time plot?
Kindly inform me is below code is right ?? as I don'see any FFT peaks in the figure 2?
clear all
close all
% 200 kHz frequency load and the length of time signal is till 10761 as shown
figure
% provides time(vs) amplitude values
E = load ('5200D1218');
%Fs = 200*10^3; %frequency load used 200kHz
T = E.data(1,1).vectorza(1,1:10761); % time
P = E.data(1,1).Amplitude(4,1:10761); % amplitude values obtained
plot(T,P);
%now to plot FFT for the amp(vs) time results
figure
p = fft(P);
plot(T,p);
Kaleesh Balahttps://de.mathworks.com/matlabcentral/profile/authors/12612866-kaleesh-balatag:de.mathworks.com,2005:Question/4451112019-02-15T08:48:39Z2019-02-16T16:43:47ZFrame by frame freqeuncy analysis of voice. below code for frame by frame analysis of wav file , Seniors Go through it and answer my question please , question is written in the last.
[data,fs]= audioread('filename.wav);
fd=0.025 % duration selected from 5 sec
f_size= round(fd*fs);% how many samples in a frame
n_f=floor(length(data)/f_size) %how many frames are there
temp=0; %temporary value
for i= 1: n_f
frames(i,:) =data (temp+1: temp+f_size);
temp=temp+f_size;
end
plot (frame(1,:))%plot first frame or any you want give there numbe .
now.my question is that how can I read frequency of that particular frame or that duration of 0.025 ms? please help me for it .Yasir Alihttps://de.mathworks.com/matlabcentral/profile/authors/14557848-yasir-alitag:de.mathworks.com,2005:Question/4452542019-02-16T03:09:11Z2019-02-16T16:42:20ZThe marker of scatter is broken when exportsThe scatter is broken when exports. How can I fix tihs problem?
CHOI HYUNDUKhttps://de.mathworks.com/matlabcentral/profile/authors/11499326-choi-hyunduktag:de.mathworks.com,2005:Question/4452252019-02-15T20:38:09Z2019-02-16T16:40:13Ztext substitute for MAT filesHello all:
I am debugging a large Matlab application from 2014 (tens of thousands of lines) and the previous developer used .MAT files to store data and also to pass it here and there. I think maybe he didn't understand how to pass data to callbacks, but that's neither here nor there. Somewhere the data is getting corrupted, and by a certain point in the application it is reliably wrong.
I thought of changing all the save() and load() functions to use the -ascii version to see if I could figure out when and where it goes wrong. Unfortunately, -ascii does not seem to save structs. Is anyone aware of a way to store and restore complicated (but not particularly large) Matlab variables as text?
Thank you,
-TomTom Sgouroshttps://de.mathworks.com/matlabcentral/profile/authors/10760063-tom-sgourostag:de.mathworks.com,2005:Question/4453152019-02-16T16:39:17Z2019-02-16T16:39:17ZMy image size is of [566 804 3], what are the useful convolution filter sizes? How can I predict them? Every where I just given the same filter size and same number of filters?layers=[...
imageInputLayer([566 804 3])
convolution2dLayer(50, 20)
reluLayer
crossChannelNormalizationLayer(2)
maxPooling2dLayer(5,'stride',2,'padding',2)
convolution2dLayer(50, 20)
reluLayer
crossChannelNormalizationLayer(2)
maxPooling2dLayer(5,'stride',2,'padding',2)
convolution2dLayer(50, 20)
reluLayer
crossChannelNormalizationLayer(2)
maxPooling2dLayer(5,'stride',2,'padding',2)
convolution2dLayer(50, 20)
reluLayer
convolution2dLayer(50, 20)
reluLayer
convolution2dLayer(50, 20)
reluLayer
maxPooling2dLayer(5,'stride',2,'padding',2)
fullyConnectedLayer(2)
softmaxLayer
classificationLayer()]GUDIVADA ROKESH KUMARhttps://de.mathworks.com/matlabcentral/profile/authors/13518531-gudivada-rokesh-kumartag:de.mathworks.com,2005:Question/4453142019-02-16T16:25:38Z2019-02-16T16:25:38ZReading CSV files in a sequence based on numeric value in file nameHello,
I am trying to read files in a sequence based on a numeric value in file name. The file names are shown a below. The numeric value at the end of each file is in a sequence. I am trying below code but this doesn't work. I am sure that I am doing something wrong with the * symbol placement.
Walk_ACLR_055_041_PSI_15_15_data_44.csv, Walk_ACLR_247_135_PSI_15_15_data_3.csv, Walk_ACLR_271_155_PSI_15_15_data_17.csv ......
clc;clear;
Labels = [];
for k = 1:150
if exist (['*',num2str(k),'.csv'],'file')
filename = ['*',num2str(k),'.csv']
T = readtable(filename);
H = height(T);
Total = H/15;
Labels = [Labels;Total];
end
endSunnyhttps://de.mathworks.com/matlabcentral/profile/authors/11874476-sunnytag:de.mathworks.com,2005:Question/4447942019-02-13T16:34:37Z2019-02-16T16:16:06ZHow to extrapolate to the point of intersection i have the following data :
x=[5 6 7 8 9 10 11 12 13 14 15 16 16.5 17 17.5 18 18.5 19 19.5 20 20.5 21 21.5 22 23 24 25 26 27 28 29 30]
y=[110.515 148.485 139.68 218.925 352.41 441.755 490.11 518.295 521.32 515.825 499.51 499.345 471.685 666.715 1100.35 936.625 484.64 568.875 1444.015 1859.38 1478.71 383.84 352.75 324 282.6 239.2 215.5 189.1 165.95 142.8 137.85 128.7]
i would like to find the x value for the intersection point with the x axis (y=0)
using extrapolation by an approximate function and how i show the equation of that function
zerguine nafissahttps://de.mathworks.com/matlabcentral/profile/authors/14771535-zerguine-nafissatag:de.mathworks.com,2005:Question/4225572018-10-06T19:42:44Z2019-02-16T16:13:59ZI am trying to generate uniformly distributed points inside a hexagon of specific centre (other than the origin). Any help is most welcome, thank you.I have seen codes like this with origin as centre only, but i need to apply it for hexagonal cells of different centres.Mystery Mysteryhttps://de.mathworks.com/matlabcentral/profile/authors/13784592-mystery-mysterytag:de.mathworks.com,2005:Question/4452612019-02-16T05:40:44Z2019-02-16T16:01:25Z'questdlg' and 'listdlg' command create a full screen dialog boxWhen I call 'questdlg' and 'listdlg', they generate huge full screen dialog box. What is the cause? Is there a way to get around? I used R2018b.Xianghttps://de.mathworks.com/matlabcentral/profile/authors/1895966-xiangtag:de.mathworks.com,2005:Question/4450782019-02-15T02:56:12Z2019-02-16T15:59:27ZA bug called"Invalid index" in simulink code building.I use the matlab 2018b. Today, I used it for stm32 code building. I can run this model in simulink, but when I build C code, there is something wrong in it called"Invalid index''. Maybe the page https://ww2.mathworks.cn/matlabcentral/answers/431624-customized-hardware-implementation-causes-a-simulink-error-invalid-index-with-2018b can solve my answer. but I don't know how to modify the customized script.
All my files are as follows.
Thank youHankun Jianghttps://de.mathworks.com/matlabcentral/profile/authors/14393469-hankun-jiangtag:de.mathworks.com,2005:Question/4453062019-02-16T14:58:58Z2019-02-16T15:54:43Zcolor calibration, mean square error i performed a radiometric calibration of the camera.how can i compare the color differences to the ground truth valuse before and after the calibration of the camera by means of a mean square error?how can i do the mean square evaluation and how to interpret the graysccale fitting?sarahttps://de.mathworks.com/matlabcentral/profile/authors/5422132-saratag:de.mathworks.com,2005:Question/4453102019-02-16T15:33:53Z2019-02-16T15:48:26ZHow ı change my label individuall to student?When I created the account I falsely choose individual but I am student and I want to change it. How can ı do?Fatma Calikhttps://de.mathworks.com/matlabcentral/profile/authors/14788507-fatma-caliktag:de.mathworks.com,2005:Question/4452292019-02-15T21:06:36Z2019-02-16T15:45:59ZHow do I Create a Matrix that connected to Excel using MATLABHow do I create a loop matrix that starts from 1X1 (value 15 as shown in the picture) to the final row lets say nX1. At the same time, it saves all the nodes corresponds to the element as shown in the figure.
Mohammad Danial Bin Kamarul Zamanhttps://de.mathworks.com/matlabcentral/profile/authors/14789773-mohammad-danial-bin-kamarul-zamantag:de.mathworks.com,2005:Question/4453072019-02-16T15:26:41Z2019-02-16T15:44:06ZAbout MATLAB R2018B updateI have checked the update of my matlab by following:
Click "Add-Ons --> Check for Updates --> Products"
The message box said that I can update my matab r2018b to matlab r2018b update3.
After the update completed, I relaunched the matlab, and check update again. And the message box also said I can update my matab r2018b to matlab r2018b update3.
Jinxue Liuhttps://de.mathworks.com/matlabcentral/profile/authors/14256596-jinxue-liutag:de.mathworks.com,2005:Question/4452182019-02-15T19:19:45Z2019-02-16T15:29:53Zadd reference point with known x y coordinates on imagesc Hi all,
I need to help about adding point on imagesc plot. I need to add a point with known x and y values (coordinates). But I know the x and y values so I do not want to use ginput or datacursormode. Could we make manual position for datacursormode? I just want to show that point on figure as a 'dot' or '+'. Any help would be great. Thanks
FikretFikret Dogruhttps://de.mathworks.com/matlabcentral/profile/authors/14760777-fikret-dogrutag:de.mathworks.com,2005:Question/4452272019-02-15T20:59:22Z2019-02-16T14:57:34ZCurve fitting in frequency domainHi everybody, was working on a polyfit for a magnitude response of a signal, I have peaks around 21 and 109 Hz, so I wish a polyfit around those frequencies. What I've done so far:
AMPLITUDE = fft(amplitude);
first_peak = 20:1:22; %poorly trying here to define the X-axis around mentioned points of 21 and 109 Hz
second_peak = 108:1:110;
amp_to_fit1 = abs(AMPLITUDE(20:22)); %take values at those points
amp_to_fit2 = abs(AMPLITUDE(108:1:110));
amp_to_fit1 = amp_to_fit1.'; %transpose
amp_to_fit2 = amp_to_fit2.';
fitted_peak1 = polyfit(amp_to_fit1, first_peak, 2); %get the fitting coefficients
fitted_peak2 = polyfit(amp_to_fit2, second_peak, 2);
n = 0;
fitting_curve1 = fitted_peak1(1)*20*20+fitted_peak1(2)*20+fitted_peak1(3) %i know this is ugly, but I am quite new to matlab :D
fitting_curve2 = fitted_peak2(1)*108*108+fitted_peak2(2)*108+fitted_peak1(3)
for n = 21:1:22
fitting_curve1 = [fitting_curve1, fitted_peak1(1)*n*n+fitted_peak1(2)*n+fitted_peak1(3)];
n = n+1;
end
for n = 109:1:110;
fitting_curve2 = [fitting_curve2, fitted_peak2(1)*n*n+fitted_peak2(2)*n+fitted_peak2(3)];
n = n+1;
end
So, in the above code I've tried to build an array fitting_curve1 (and 2), having 3 points at 3 frequencies. (I will add more points later). However, values of the fit are far from what I expected. I anticipate that the issue is in my values of X-axis (how I define first_peak and second_peak variables), I have also the vector with time information from the initial signal.
Still finding my way around fft, so can not find the correct solution so far. Would appreciate some advice. ThanksKirill Chukhlantsevhttps://de.mathworks.com/matlabcentral/profile/authors/14674311-kirill-chukhlantsevtag:de.mathworks.com,2005:Question/4452742019-02-16T08:58:13Z2019-02-16T14:48:31ZFFT from CSV fileI'm trying to perform FFT on the 2nd data column of a .csv file. The .csv file is quite large and the zipped version can be found here: https://www.dropbox.com/s/87l5vtxdqfbtt6x/Tridral_1m_1ms.7z?dl=0
The signal is 10 milliseconds long, and is sampled 1 million times over that time period. I've tried following the FFT example provided by the help file, but the frequency domain signal does not come out right. The FFT output gives a strong DC signal (that could be right), and a signal at 50 KHz. Based on the time domain signal, i should expect approximately a 1 KHz fundamental with recurrent harmonics at 2, 3, 4 KHz..., but it comes out empty... am i doing something wrong in my code?
Ray Fanghttps://de.mathworks.com/matlabcentral/profile/authors/14791516-ray-fangtag:de.mathworks.com,2005:Question/4452452019-02-16T00:42:40Z2019-02-16T14:35:12ZNeed help writing a for loopSo I was assigned a project where I wrote a function f that takes inputs q, Tc and T and returns a number according to a chemistry equation. The second part of the assignment was to write a program that loops 50 values of T between 0.5 and 1.3 and finds the value of q that minimises the value of f (using fminsearch) at a given T where Tc always = 1. I wouldn't normally use a loop to do this, but we have to here so here's what I have so far which is probably very wrong but I don't really know how to get it to work. We have to plot a graph of the min q values against the T values but my graph comes back blank.
Thanks for the help.
Ti = 0.5;
Tf = 1.3;
nT = 50;
for iT = 1:nT
T = Ti + (Tf - Ti)*iT/(nT-1);
Te(iT) = T;
qmin = fminsearch(@(q) f(q,1,T), T);
end
plot(T,qmin)Jack Svilmshttps://de.mathworks.com/matlabcentral/profile/authors/14772185-jack-svilmstag:de.mathworks.com,2005:Question/792442013-06-17T02:04:08Z2019-02-16T14:26:50Zset latters in a string to different fontsizes with interpreter latexI want to set latters in a string to different fontsizes with interpreter latex, but the following commond doesn't work. Why?
text('position',[0.8 0.9 0],'interpreter','latex',...
'string','$\fontsize{12}{xxx}\fontsize{8}{yyyy}$',...
'fontname','Times New Roman');
Thanks! yang yanghttps://de.mathworks.com/matlabcentral/profile/authors/3161535-yang-yangtag:de.mathworks.com,2005:Question/4453022019-02-16T14:05:19Z2019-02-16T14:18:48ZFunction for user to define any nxn matrix. Hey gang,
For uni I need to create a function script that will allow a user to take any 2 nxn matrices and multiply them together.
I realise matlab can do this anyway but the exercise is to understand some of how matlab works.
My issue is that I don't actually know how to set it up so that my matrix will absorb any values put into it. From there I reckon I can do the assignment.
Any help would be just fab. Sorry if my request seems abit confusing, I can't think of how to word what I want very well.
Thanks!Harrison McAleesehttps://de.mathworks.com/matlabcentral/profile/authors/9257220-harrison-mcaleesetag:de.mathworks.com,2005:Question/4452912019-02-16T11:54:46Z2019-02-16T14:05:36ZWhy i can't use the function Graph::isEdge in my code??This is my code and i try to create a graph
clear all;
fileID = fopen("routers_modify_airports.dat");
data = textscan(fileID,'%q %q');
fclose(fileID);
Data_of_ports = [data{:}];
unique_elements = unique(Data_of_ports);
G = graph;
for i = 1 : length(unique_elements)
G = addnode(G,unique_elements(i));
end
for i = 1: length(Data_of_ports)
G = addedge(G,Data_of_ports(i,1),Data_of_ports(i,2));
end
And i have a problem in function addedge because i have two time the same edge . For exapmle
'AER' 'KZN'
'ASF' 'KZN'
'ASF' 'MRV'
'CEK' 'KZN'
'CEK' 'OVB'
'DME' 'KZN'
'DME' 'NBC'
'DME' 'TGK'
'DME' 'UUA'
'EGO' 'KGD'
'EGO' 'KZN'
'GYD' 'NBC'
'KGD' 'EGO'
'KZN' 'AER'
I find a function who check if is the edge exists. But i can't use it.
for i = 1: length(Data_of_ports)
if (Graph::isEdge(G, [[Data_of_ports(i,2), Data_of_ports(i,1)]] )) == false
G = addedge(G,Data_of_ports(i,1),Data_of_ports(i,2));
end
end
And i have this Error
Do you know how to use this function???John Bluehttps://de.mathworks.com/matlabcentral/profile/authors/14165380-john-bluetag:de.mathworks.com,2005:Question/4452862019-02-16T11:10:34Z2019-02-16T14:05:01ZHow I can Plots this function how can write the code of this function
Mohamed Husseinhttps://de.mathworks.com/matlabcentral/profile/authors/14798107-mohamed-husseintag:de.mathworks.com,2005:Question/4453012019-02-16T14:03:42Z2019-02-16T14:03:42ZAssign a value on the center of a surface using pseudocolor plot
Using the following code I generate the graph. Values of C are defined in the X,Y coordinates that is not what I want.
What I want is to assign a single value on the surface of each of 3x2 surface. Each value would be defined by a C [3x2] matrix.
close all;clear all;clc
x = linspace(0,10,4);
y = linspace(0,20,3);
[X,Y] = meshgrid(x,y)
C = rand(3,4);
pcolor(X,Y,C)
colorbar
xlabel('x-axis')
ylabel('y-axis')
zlabel('C')DIMITRIS GEORGIADIShttps://de.mathworks.com/matlabcentral/profile/authors/9794830-dimitris-georgiadistag:de.mathworks.com,2005:Question/4452852019-02-16T11:04:16Z2019-02-16T13:56:49Zconvert image to bitmap map image without using for loopPartition an image into 4 × 4 pixel blocks and
compute average for the block
N1 = N2 = 4
xi = ith pixel
now replace the values to 1 and zero to create a bitmap image.
Without using for loop, how can i write these 2 equations in simple code
Also how to get back, the original image from bitmap imageElysi Cochinhttps://de.mathworks.com/matlabcentral/profile/authors/3625227-elysi-cochintag:de.mathworks.com,2005:Question/4453002019-02-16T13:33:01Z2019-02-16T13:56:24ZIt shows: Undefined function 'permute' for input arguments of type 'function_handle' when i solve the double integration with trapezoidal method. Can I know how to solve this?clear all
clc
Q=((2000*42*(3.785*10^-3))/(1*24*3600)); %volumetric flowrate of fluid in m3/s
D=(4*0.0254); %inner diameter of pipe in m
A=(pi()*(D^2))/4; %cross sectional area of pipe in m2
uave=Q/A; %average velocity in m/s
R=D/2; %radius of the pipe in m
radius=[0:0.0002:R];
dita=[0:pi():2*pi()];
[RADIUS,DITA]=meshgrid(radius,dita);
F=@(RADIUS,DITA) RADIUS.*(1-((RADIUS./R).^2));
I=trapz(dita,trapz(radius,F,2));
%umax is the maximum velocity in m/s
umax=uave/I
%u is the velocity of pipe in m/s
u=umax*(1-((radius./R).^2));Sylvia Tanhttps://de.mathworks.com/matlabcentral/profile/authors/12101285-sylvia-tantag:de.mathworks.com,2005:Question/4451292019-02-15T10:29:04Z2019-02-16T13:51:18ZHow to remove the extra symbols in a box figure?I got a box figure that is shown here.
This figure includs a red line and a series of box-whisker column.
But there are some red plus symbols under these box columns, and I wonder how to remove these red symbol.
ZHENRONG TIANhttps://de.mathworks.com/matlabcentral/profile/authors/14009593-zhenrong-tian