https://nl.mathworks.com/matlabcentral/answers/questionsMATLAB Answers — New Questions2019-07-19T05:55:59Ztag:nl.mathworks.com,2005:Question/4724402019-07-19T03:39:23Z2019-07-19T05:55:14Zgenerate Gaussian noise with certain mean and varianceI want to produse Gaussian noise. So, I use normrnd.
m=0.17;
n=normrnd(6.*m,m.*m);
I think the n should be sometimes negative number as it is Gaussian. But always be positive number. So normrnd is correct way to do this?
Naimehttps://nl.mathworks.com/matlabcentral/profile/authors/13711668-naimetag:nl.mathworks.com,2005:Question/4724452019-07-19T05:32:14Z2019-07-19T05:55:59ZBisection help PLS HELP MEI have this code for a bisection method but I cant seem to figure out why it wont work I just get this error
the task is to Use the bisection method is find the approximation for w between 41 and 69 and the equation is x=(2*Fo/wn.^2-w.^2)*sin((wn-w/2)*t)*sin((wn+w/2)*t); every thing else is given
any help is appreciated thanks
Error using *
Incorrect dimensions for matrix multiplication. Check that the
number of columns in the first matrix matches the number of rows in
the second matrix. To perform elementwise multiplication, use '.*'.
Error in bisectiona>f (line 65)
x=(2*Fo/wn.^2-w.^2)*sin((wn-w/2)*t)*sin((wn+w/2)*t);
Error in bisectiona (line 14)
f_left = f(x_left);
function bisectiona
% Bisection method: Used for solving an equation, and finding an
% approximate solution to an equation.
clc
% The number of bisection steps
n = 32;
% define the initial interval
a = 41;
b = 69;
fprintf('\n initial interval [%g, %g] \n total bisection steps %d\n', a,b,n);
% Check that a root does exist in the chosen interval
x_left = a;
x_right = b;
f_left = f(x_left);
f_right = f(x_right);
if f_left*f_right > 0
end
% Bisection: The method
for i=1:n
if f_left == 0
% The exact root of the equation is found at the lower bound
% of the chosen interval
fprintf('\n stage %g root %g with zero absolute error \n',i,x_left);
return;
end
if f_right==0
% The exact root of the equation is found at the upper bound
% of the chosen interval
fprintf('\n stage %g root %g with zero absolute error \n',i,x_right);
return
end
% Bisection method: The process
x_mid = (x_left+x_right)/2.0;
f_mid = f(x_mid);
if f_left*f_mid <= 0
% There is a root in [x_left,x_mid]
x_right = x_mid;
f_right = f_mid;
end
if f_left*f_mid > 0
% There is a root in [x_mid,x_right]
x_left = x_mid;
f_left = f_mid;
end
% Calculate the approximate root for current step
root = (x_left+x_right)/2.0;
% Calculate the absolute error for current step
abs_err=(x_right-x_left)/2.0;
fprintf('\n stage %g root %g absolute error < %g \n',i,root,abs_err);
end
%check satisfaction of equation at end of process
residual = f(root);
fprintf('\n final residual = %g \n',residual);
end
%Created Subfunction to define equation f(x)
function f_value = f(~)
k = 2800;
m = 0.6705;
Fo = 2.0535;
t = 9.177;
x = 0.0253;
w = 77:0.1:80;
wn= sqrt(k/m);
fo= Fo/m;
x=(2*Fo/wn.^2-w.^2)*sin((wn-w/2)*t)*sin((wn+w/2)*t);
f_value = x;
endTriggshttps://nl.mathworks.com/matlabcentral/profile/authors/9080447-triggstag:nl.mathworks.com,2005:Question/4721092019-07-17T08:38:09Z2019-07-19T05:48:57ZDelete table from GUI app variableHi all,
I have a GUI designed in Matlab called app. In app there is a table table that a certain point I want to delete to save memory, how can I do it? clear app.table does not work
ThanksFederico Fhttps://nl.mathworks.com/matlabcentral/profile/authors/14597349-federico-ftag:nl.mathworks.com,2005:Question/4724462019-07-19T05:46:32Z2019-07-19T05:46:32ZPolyspace compile error for "_Bool" type name by using diab compilerWe have a self-defined type named "_Bool", as below:
typedef unsigned char uint8_t;
typedef uint8_t _Bool;
When we do the Code prover analysis of the C file, it popup error:
We know the C99 standard using "_Bool" as default boolean type, but we check the "C90 standard", still not work!
It not happened when we select other compilers!Gabe Xuhttps://nl.mathworks.com/matlabcentral/profile/authors/15830612-gabe-xutag:nl.mathworks.com,2005:Question/3869512018-03-07T20:04:00Z2019-07-19T05:44:42ZUpdate app.textarea inside a parfor loop I'm trying to update app.TextArea in the app designer using
<https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/32101/versions/3/previews/parfor_progress.m/index.html?access_key= parfor_progress>
Error: Valid indices for 'app' are restricted in PARFOR loops.
How would I fix the sliced variable that is 'app' or is it just impossible with parfor and the app designer?
Using Matlab 2017b
Example code below:
clear;
clc;
num_iter=100;
percent=parfor_progress(num_iter);
parfor i=1:num_iter
pause(randi(10));
percent=parfor_progress;
app.TextArea.Value={percent};
end
parfor_progress(0);
Any help/links for further reading would be helpful.
Thanks
Nick
Nick LaSortehttps://nl.mathworks.com/matlabcentral/profile/authors/9428202-nick-lasortetag:nl.mathworks.com,2005:Question/2668232016-02-05T05:00:00Z2019-07-19T05:42:47ZI get a error "An error occurred during a write access to Job-1.mdl file" only when using Abaqus while MATLAB is running.I am using Abaqus while MATLAB in running. Then Abaqus is executing on the same folder as the current folder of MATLAB, I get an error
ERROR: An error occurred during a write access to Job-1.mdl file.
This happens only when MATLAB is running in the same folder as Abaqus. Why do I get this error? Is there a workaround?MathWorks Support Teamhttps://nl.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:nl.mathworks.com,2005:Question/4718082019-07-15T18:17:18Z2019-07-19T05:37:21ZHow to call function in matlab appdesigner under parforloopI can not call function under parforloop in matlab appdesigner. It's showing me the following error: Functionality not supported with figures created with the uifigure function. Here is my code
function func1(app)
disp(strcat('Function 1----',datestr(now)));
pause(2);
disp(strcat('Function 1----',datestr(now)));
end
function func2(app)
disp(strcat('Function 2----',datestr(now)));
pause(2);
disp(strcat('Function 2----',datestr(now)));
end
function StartAutomationButtonPushed(app, event)
parfor i = 1:2
if i == 1
func1(app);
else
func2(app);
end
end
end
Ashadullah Shawonhttps://nl.mathworks.com/matlabcentral/profile/authors/5413453-ashadullah-shawontag:nl.mathworks.com,2005:Question/4724442019-07-19T05:26:20Z2019-07-19T05:36:58ZError: Not enough input argument (line 6)function L = QoS(Data,model,estR,estE)
load('HMMParam.mat');
S = xlsread('Dataset.xlsx');
model = model(1:size(Data,1));
model = model/max(model(:));
model = round(model);
R = logical(model);
T = Data(R,:);
G = zeros(sum(R),1);
for i = 1:sum(R)
Q = T(i,:);
Co = hmmdecode(Q,estR,estE);
Q = Q.*Co;
G(i) = sum(Q);
end
L = 1 - mean(G);
endsalar sefatihttps://nl.mathworks.com/matlabcentral/profile/authors/15831001-salar-sefatitag:nl.mathworks.com,2005:Question/4714152019-07-12T08:22:52Z2019-07-19T05:33:51ZSimulink Log data to same file as InputHello everyone,
I use the dataref input streaming as it is described here:
https://de.mathworks.com/help/simulink/slref/working-with-big-data.html#d117e564994
My problem is, that I want the output of the model (or signals in between) to be appended to the same file as the input dataref. If i select the input dataref file in the (Configuration Parameters > Data Import/Export > Log Dataset data to file) , the data is deleted/overwritten.
Does anybody know to come around from the issue?
Thank you!
Oli
OliverMaierhttps://nl.mathworks.com/matlabcentral/profile/authors/14184317-olivermaiertag:nl.mathworks.com,2005:Question/4723132019-07-18T09:51:29Z2019-07-19T05:23:18ZHow to find x and y value of top corner of the image Please help me to auto detect x and y cordinate of the higlight with red rectangle symbol in jpgMuhammad Umar khanhttps://nl.mathworks.com/matlabcentral/profile/authors/15782880-muhammad-umar-khantag:nl.mathworks.com,2005:Question/4723792019-07-18T15:28:48Z2019-07-19T05:19:44Zhow to identify clear leaf in this image.I am trying to identify greenness with the help of Tuned Tri-threshold Fuzzy Intensification Operators. I tried a lot to remove white pixels which around the edges of the final image.please help me to identify clear leaf of greenness.
Function
function out = TTFIO(image, tao, zeta)
[row col]=size(image);
%% Calculating the Membership Function
img = (image - min(image(:)))./(max(image(:)) - min(image(:)));
%% Applying Intensification Operators
for j = 1:row
for k = 1:col
if img(j,k) <= tao
enhanced(j,k) = 2*img(j,k)^2;
else
enhanced(j,k) = 1-2*(1-img(j,k))^2;
end
end
end
%% Tuning the Output
out=((enhanced).^(tao+zeta));
Read Image
zeta=.5;
x=im2double(imread('corn seedling wheat straw on sunny day.jpg'));
x=imresize(x,[256 256]);
figure; imshow(x);
img1=rgb2hsv(x);
H=img1(:,:,1).*255;
S=img1(:,:,2).*255;
V=img1(:,:,3).*255;
H( (H<5) | (H>150)) = 0;
H(H>65&H<80&S>2&10&V>150) = 0;
figure,imshow(uint8(S));
% x_R=x(:,:,1); x_G=x(:,:,2); x_B=x(:,:,3);
tao_R=.9; tao_G=.8; tao_B=.5;
R=(TTFIO(H,tao_R,zeta));
G=(TTFIO(S,tao_G,zeta));
B=(TTFIO(V,tao_B,zeta));
out=cat(3,R,G,B);
t=graythresh(out);
BW=im2bw(out,t);
figure,imshow(out)
BW=bwareaopen(BW,175);
BW = imclearborder(BW);
figure;
imshow(BW)
this is the original image
final result.tashu Dabariyahttps://nl.mathworks.com/matlabcentral/profile/authors/10761538-tashu-dabariyatag:nl.mathworks.com,2005:Question/4723142019-07-18T09:56:27Z2019-07-19T05:18:48ZUsing for loops in referencingHello everyone
I would like to create new datasets separately through a for loop.
for n=0:5:40
netload'n'=Y-n.*Koutput
end
% the results should give me nine outputs which would be somethig like
netload0=Y-0.*Koutput
netload5=Y-5.*Koutput
"" + ...
""
netload40=Y-40.*Koutput
How can I execute that using a for loop?
Thank you.Luihttps://nl.mathworks.com/matlabcentral/profile/authors/12223275-luitag:nl.mathworks.com,2005:Question/4553492019-04-09T17:12:42Z2019-07-19T05:08:54ZHow to draw line and hold it?Hi, I am working on image processing and I would like to make stop and hold on. Anyone can help on this?Josh Hwahttps://nl.mathworks.com/matlabcentral/profile/authors/11331003-josh-hwatag:nl.mathworks.com,2005:Question/4721072019-07-17T08:06:00Z2019-07-19T05:07:35Zhow to normalize data?Hi all
I have a wrong program step. I don't know what is wrong with my program script.
I have data per 10 minutes which is divided into 7 columns, time and data.
09/10/2014 3:00 0
09/10/2014 3:10 0
09/10/2014 3:30 0.4
09/10/2014 3:50 0.4
09/10/2014 4:00 0.4
09/10/2014 4:10 0.4
09/10/2014 4:20 0.4
09/10/2014 4:30 0.4
10/10/2014 4:40 0.4
09/10/2014 4:50 0.4
09/10/2014 5:00 0.4
09/10/2014 5:10 0.4
09/10/2014 5:20 0.4
It can be seen that at 3:20 a.m. and the value of the data is empty, I want to get data per 10 minutes with empty data filled with 0 / nan.
I use matlab 2014b. there is no retime function so I have trouble ... I have asked before in this forum but have not received suggestions that are in accordance with this program. I attach the following data. I say thank you to anyone who has tried to help and advise ...
jan risnJan Risnhttps://nl.mathworks.com/matlabcentral/profile/authors/15339921-jan-risntag:nl.mathworks.com,2005:Question/3520242017-08-08T17:51:44Z2019-07-19T05:01:14ZProgrammatically performing "Expand axes to fill figure"?I need to automate generating figures and exporting them (usually to png). I can get what I need by using "File: Export Settings" & clicking "Expand axes to fill figure", but I really do not want to do this as many times as would be needed. How do I do it from a script or function? I have hunted through all of the properties options that I can think of but can't find that one - or can't get other options to work right. Thank you. Nancy Jestelhttps://nl.mathworks.com/matlabcentral/profile/authors/827877-nancy-jesteltag:nl.mathworks.com,2005:Question/4701852019-07-04T06:30:14Z2019-07-19T04:41:56ZToo many output argument Hi, I am trying to plot a 3D gyroid using the following code
fimplicit3(@(x,y,z) sin(x).*cos(y) + sin(y).*cos(z) + sin(z).*cos(x))
but it shows me too many output argument as the error. Also a bank 3D plot opens up with only X Y Z axis.
Can you help? Yash Mistryhttps://nl.mathworks.com/matlabcentral/profile/authors/13314579-yash-mistrytag:nl.mathworks.com,2005:Question/577722013-01-02T09:47:19Z2019-07-19T04:38:33Zhow to delete mat filei have saved a variable by using
save('fp_database.mat','data');
i want to delete this file so i tried
delete('fp_database.mat')
now even i load it by load('fpnn_database.mat');its values are displayed and not deleted
please tell how to delete it
Pathttps://nl.mathworks.com/matlabcentral/profile/authors/3009067-pattag:nl.mathworks.com,2005:Question/4706702019-07-08T09:53:32Z2019-07-19T04:33:32Zhow to use the if function for data with a matrix 855 * 6hy everyone, i new to matlab. i use matlab 2013a. my problem is not understanding in making programs in the form of looping functions for different years. my data is in the form of netcdf. the matrix of my data is 855*6. 855, starting 1948 until 2019 and each year consist of 12 months. the different years are for example 1987, 1998, 2000, and 2006. i ask ou thank you for giving me advice and hel with my problem.
Evelyne Aiyanahttps://nl.mathworks.com/matlabcentral/profile/authors/15777402-evelyne-aiyanatag:nl.mathworks.com,2005:Question/4722692019-07-18T05:23:17Z2019-07-19T04:28:39Zusing runge kutta 4th order to integrate three different dynamic equation% silmulating the rossler and lorenz attractor
% rossler is the driver
%lorenze as the response
% dx = [-(x(2)+ x(3));x(1) + a*x(2);b + x(3)*(x(1)-c)];
%ds = [sigma*(s(2)- s(1)); s(1) *( rho-s(3))-s(2); s(1)*s(2)-beta*s(3)];
% dz = [sigma*(z(2)- z(1));z(1) *( rho-z(3))-z(2);z(1)*z(2)-beta*z(3)];
a= 0.2; b= 0.2;c= 5.7; sigma= 16; beta= 4; rho = 45.92;g = 0;
% Define function handles
dx = [
-(x(2)+ x(3));
x(1) + a*x(2);
b + x(3)*(x(1)-c);
sigma*(s(2)- y(1))-g*(s(1)-x(1));
s(1) *( rho-s(3))-s(2);
s(1)*s(2)-beta*s(3);
sigma*(z(2)- z(1))-g*(z(1)-x(1));
z(1) *( rho-z(3))-z(2);
z(1)*z(2)-beta*z(3);
];
% setting initial conditions
epsu = [0.06;0.01;1];
epsv = [0.85;0.85;1];
epsw = [0.05;0.01;1];
dt = 0.01;
tspan = (dt:dt:1000);
x = zeros(3,tspan(end)/dt);
s = zeros(3,tspan(end)/dt);
z = zeros(3,tspan(end)/dt);
for i = 1: tspan(end)/dt
time = i*dt;
k1x = fx(epsu(i), x(i), a,b,c);
k1y = fx(epsv(i), x(i),s(i),z(i));
k1z = fx(epsw(i), x(i),s(i),z(i));
k2x = fx(x(i)+(dt/2),x(i)+(dt/2)*k1x,s(i)+(dt/2)*k1y,z(i)+(dt/2)*k1z);
k2y = fy(e(x)+(dt/2),x(i)+(dt/2)*k1x,s(i)+(dt/2)*k1y,z(i)+(dt/2)*k1z);
k2z = fz(e(x)+(dt/2),x(i)+(dt/2)*k1x,s(i)+(dt/2)*k1y,z(i)+(dt/2)*k1z);
k3x = fx(e(x)+(dt/2),x(i)+(dt/2)*k2x,s(i)+(dt/2)*k2y,z(i)+(dt/2)*k2z);
k3y = fy(e(x)+(dt/2),x(i)+(dt/2)*k2x,s(i)+(dt/2)*k2y,z(i)+(dt/2)*k2z);
k3x = fz(e(x)+(dt/2),x(i)+(dt/2)*k2x,s(i)+(dt/2)*k2y,z(i)+(dt/2)*k2z);
k4x = fx(e(x)+(dt),x(i)+(dt)*k3x,s(i)+(dt)*k3y,z(i)+(dt)*kz);
k4y = fy(e(x)+(dt),x(i)+(dt)*k3x,s(i)+(dt)*k3y,z(i)+(dt)*kz);
k4z = fz(e(x)+(dt),x(i)+(dt)*k3x,s(i)+(dt)*k3y,z(i)+(dt)*kz);
x(i+1)= e(x)+(dt/6) *(k1x +2*k2x +2*k3x +k4x);
s(i+1)= e(y)+(dt/6) *(k1y +2*k2y +2*k3y +k4y);
z(i+1)= e(z)+(dt/6) *(k1z +2*k2z +2*k3z +k4z);
end
COMMAND WINDOW: ERROR MESSAGE BELOW
Undefined function or variable 's'.
Error in silmu (line 15)
sigma*(s(2)- y(1))-g*(s(1)-x(1));
Kindly tell me where am wrong please
Samsonhttps://nl.mathworks.com/matlabcentral/profile/authors/14635796-samsontag:nl.mathworks.com,2005:Question/4724422019-07-19T04:15:31Z2019-07-19T04:27:25ZIs it possible to create a state space component in Simscape?I have a DAE in the following form
The DAE corresponds to some circuit. The input corresponds to the voltage at the ports and is the current flowing through those ports. I'd like to be able to create custom Simscape component for this system.
I did find this answer, that has help me get started but I'm very far off still. My system happens to have three ports. I have the following very wrong attempt that I figured I'd include.
component myComponent
% Non-working attempt at creating a Custom Simscape component
% from a state space system
nodes
p=foundation.electrical.electrical; % 1:left
n=foundation.electrical.electrical; % 2:left
d=foundation.electrical.electrical; % 3:right
end
variables
i = { 0, 'A'};
v = { 0, 'V'};
end
function setup
E = hdf5read('myDAE.h5','E');
A = hdf5read('myDAE.h5','A');
B = hdf5read('myDAE.h5','B');
C = hdf5read('myDAE.h5','C');
end
equations
E*x.der == A*x+B*v;
i == C*x;
end
endEdgar Galvanhttps://nl.mathworks.com/matlabcentral/profile/authors/15319769-edgar-galvantag:nl.mathworks.com,2005:Question/4702612019-07-04T13:16:14Z2019-07-19T04:19:45Zlabelling multiple images at once by rgbCan Anyone please help me in labelling my images (1000) based on r g b ?or is it possible to directly label them while applying deep learning for rgb class if so can any one help?Akash Kuberhttps://nl.mathworks.com/matlabcentral/profile/authors/13898706-akash-kubertag:nl.mathworks.com,2005:Question/4724412019-07-19T04:12:55Z2019-07-19T04:18:07ZReshape Matrix Size MarlabI have a code like this :
a = randi ([100 200], 4000,8);
b = de2bi(a);
c = b(:);
how to make the C matrix back into the B matrix?
Thanks beforeIbnu Darajathttps://nl.mathworks.com/matlabcentral/profile/authors/11580562-ibnu-darajattag:nl.mathworks.com,2005:Question/4711302019-07-10T17:54:47Z2019-07-19T04:16:45ZBootstrapping a square matrixHi everyone. I'm in the necessity to understand how to bootstrap a square matrix in order to get the confidence interval for the following phylogenetic tree that I have to draw. Any suggestions?Bio_Ing_Sapienzahttps://nl.mathworks.com/matlabcentral/profile/authors/6181309-bio_ing_sapienzatag:nl.mathworks.com,2005:Question/913032013-10-24T04:17:46Z2019-07-19T04:08:25ZHow to convert a code from C language to Matlab?Dear all,
I have a code written in C language that detect the lines between cells in confocal images using the Watershed method. I want to use this C code in matlab. Is there any way to do so? Meshooohttps://nl.mathworks.com/matlabcentral/profile/authors/178590-meshoootag:nl.mathworks.com,2005:Question/4724372019-07-19T03:04:51Z2019-07-19T04:07:21ZChanges matrix size matlabi generate this binary (16x1) :
A = randi ([0 1], 16,1);
and the result is :
0
0
0
1
1
0
1
0
0
0
1
1
0
0
0
1
My question is, how to make the matrix A become 2x8 matrix? So, the result like :
0 0 0 1 1 0 1 0
0 0 1 1 0 0 0 1
Thanks beforeIbnu Darajathttps://nl.mathworks.com/matlabcentral/profile/authors/11580562-ibnu-darajattag:nl.mathworks.com,2005:Question/4724222019-07-18T22:09:29Z2019-07-19T04:06:51ZWater Filtration Problem for a classI need to find the minimum number of stages that are needed to remove 99% of the initial impurity level of water.
I have a FOR loop set up to due the filtration like so:
for n = 1:21
n_stage(n) = n-1:
y(n) = (1/3)^(n-1);
if (y(n) <= 0.01) Here's where my issues start.
n_1p(n) = n_stage(n);
y_1p(n) = y(n);
end
end
fprintf('Minimum number of stage for 99%% filtration = %d, impurity level = %f\n',n_1p,y_1p);
#1: I'm getting two many answers because I'm not sure how to get the IF statement to stop.
#2: When it prints, it doesn't print the filtration stage (n_1p) nor the impurity level (y_1p) as would expect.
My programming skills are kinda lackluster. This is for a class I'm taking to help with said skills. Any help would be greatly appreciated.Troy Brownhttps://nl.mathworks.com/matlabcentral/profile/authors/15668030-troy-browntag:nl.mathworks.com,2005:Question/4721502019-07-17T12:24:56Z2019-07-19T03:49:22ZHow to find the area of a segmented image in matlab?I need to find the total area of the segmented image(attached below) in Matlab. However i am not able to get that if i use regionprops('Area') command. It gives me total pixel size which is 2048*2048 but i need to find the area of only the segmented region(Black)? Please tell me how to do it.
Ramanathan Anandarama Krishnanhttps://nl.mathworks.com/matlabcentral/profile/authors/11234494-ramanathan-anandarama-krishnantag:nl.mathworks.com,2005:Question/4724382019-07-19T03:12:32Z2019-07-19T03:46:03Z MATLAB SABER (spatial and biological evaluation for radiotherapy)Good day,
I'm a Radiation Oncologist, I need to have information about SABER (spatial and biological evaluation for radiotherapy) from MATLAB.
Which version of MATLAB have an access to use SABER tool.
I'll be awaiting your reply.
Regards,
Dr. Raturi Vijay ParshuramVijay Raturihttps://nl.mathworks.com/matlabcentral/profile/authors/15827409-vijay-raturitag:nl.mathworks.com,2005:Question/4724392019-07-19T03:24:38Z2019-07-19T03:35:24ZHow to import variables to excel sheet?Hi,
I am working on image segmentation and feature extraction. After extracting features like geometric and texture, i get them as variables.
stats,area,perimeter etc. I get around 15 variables where stats is an 12*1 struct and holds 12 values inside it(GLCM). How to import all these values to excel sheet automatically? I need to use excel sheet for image classification further. I use Matlab 2014a. Please help me in this. Thank You.Ramanathan Anandarama Krishnanhttps://nl.mathworks.com/matlabcentral/profile/authors/11234494-ramanathan-anandarama-krishnantag:nl.mathworks.com,2005:Question/4724342019-07-19T02:49:05Z2019-07-19T03:29:12ZHow can I plot a serie data using linspace?Hi everybody
I´m trying to plot 59 data (the variable a and b), but those data corresponds to 90 days, the difference between data and days is because there were days with no measurements.
I´m using this command:
a = E_D/E_C;
b = 1 - a;
x = linspace(0, 90, numel(E_C));
X = [x].';
Y = [b];
err=[E_desv_C(:) E_desv_D(:)];
errorbar(X,Y,err)
xticks(0:5:90);
but appears this error
Error using errorbar>checkSingleInput (line 269)
XData must be the same size as YData.
Error in errorbar (line 94)
x = checkSingleInput(x, sz, 'XData');
Error in Untitled (line 65)
errorbar(X,Y,err)
How can I fix this?
Thank u!Jonathan Bijmanhttps://nl.mathworks.com/matlabcentral/profile/authors/11143831-jonathan-bijmantag:nl.mathworks.com,2005:Question/4724362019-07-19T03:00:51Z2019-07-19T03:27:17ZError 0x80070008 for hwnd 0000000000E312F6 on system call in file b:\matlab\src\uiw\events\win7spec.cpp, line 8aA couple of weeks ago, I upgraded Matlab to 2019a and have used it without any problem. But this evening, I found Matlab produced following error whenever I opened Matlab.
Error 0x80070008 for hwnd 0000000000E312F6 on system call in file b:\matlab\src\uiw\events\win7spec.cpp, line 8a
Few scripts I tried seemed running OK in spite of this error. But I would like to know what's going on with this error. Any hint would be appreciated.Daniel Thomashttps://nl.mathworks.com/matlabcentral/profile/authors/3535769-daniel-thomastag:nl.mathworks.com,2005:Question/4715292019-07-13T04:16:05Z2019-07-19T03:21:56ZHow can I create a (printable) image (jpeg, bitmap, tiff...any format is ok) starting from a binary code? My goal is to translate a (relatively long) text file into an image file, by converting the text into a binary code (first step) and then using the binary code to create an image (second step). I have completed the first step and I have a big string of binary code, now, which I want to translate in an image. I am ok with the process being messy and unpredictable, as my goal is artistic and conceptual. I am extremely curious to see what image would result from this, and I would be curious to see if there are ways to format the binary code so that it creates a colorful unpredictable image.
I am new to Matlab, but it looks like people have been able to make images from binary code using this software. I have tried to understand how, but with no luck.
I hope someone will be able to help and thanks a lot in advance.
E.
Emi Vahttps://nl.mathworks.com/matlabcentral/profile/authors/15802377-emi-vatag:nl.mathworks.com,2005:Question/2176302015-05-19T19:35:19Z2019-07-19T03:21:18Z"could not execute UHD driver command" error for N210 USRP using Simulink examples under Matlab2013aOne month ago, I have gone through the Windows setup steps, when running *radios=findsdru* command, I was receiving that UHD version on the N210 module is not compatible with the one on the MAtlab 2013a version I am using. I have followed the instructions to upgrade UHD by using the command:
*!C:/Python34/python.exe C:\MATLAB\SupportPackages\R2013a\EttusResearch-UHD-Mirror-7f44d83\host\utils\usrp_n2xx_net_burner_gui.py*
after that, *radios=findsdru* command was indicating success, a log document is attached showing results of this command and *probesdru* command. the images usde as of version 003.004.002 which are said to be compatible with the Matlab version I have.
When trying to run one of the simulink examples available on the matlab support package (namely: sdruQPSKtransmitter), it gives me an error shown in the attached image file, while not seing any RF signal on the antenna connector of the attached SBX40 RF board .
when trying the matlab code counterpart, I can see many UHD: U errors in the main matlab windown, while failing to see any RF signal on the antenna connector too!!
it seems Matlab is not able to send required design parameters although it was able to see the N210 successfully.
Any help??Ghada Hamdyhttps://nl.mathworks.com/matlabcentral/profile/authors/6329108-ghada-hamdytag:nl.mathworks.com,2005:Question/4724352019-07-19T02:55:32Z2019-07-19T02:55:32ZProblem working on Comparative evaluation of LMS and RLS algorithms in equalization technique over a rayleigh fading channel using simulink... please i need a simulink block for the project. ThanksComparative evaluation of LMS and RLS algorithms in equalization technique over a rayleigh fading channel using simulink , my problem is the output of the error for both RLS and LMS blocks are giving me thesame output... please i someone should help me out. The sumulink file is attached below. Thanks.Afeez Oyedejihttps://nl.mathworks.com/matlabcentral/profile/authors/13388156-afeez-oyedejitag:nl.mathworks.com,2005:Question/490772012-09-25T19:47:15Z2019-07-19T02:49:13ZHow to import equation from GUI to functions?I want the user to be able to insert his own equation (e.g. a*x.^2 + b*x + c) to be used to plot the function. I have already defined the variables a, b and c (to which it will be limited) and have everything working if I put y=*equation* in the .m file. How would I point Matlab towards using what is in the GUI text box (the equation input) to answer y=... and plot accordingly?
Johnhttps://nl.mathworks.com/matlabcentral/profile/authors/3718419-johntag:nl.mathworks.com,2005:Question/4724332019-07-19T02:18:16Z2019-07-19T02:37:04ZHow can make a vector from a structure?I have this structure from a data set I was sent and have to make a simple scatter plot with di and from the field 100 and yi from field 100. How do I turn each of those things into vectors so I can in turn plot them up. Im brand new to matlab so this is quite confusing to me any help would be great. Austin Scheinkmanhttps://nl.mathworks.com/matlabcentral/profile/authors/15824342-austin-scheinkmantag:nl.mathworks.com,2005:Question/4724152019-07-18T20:48:13Z2019-07-19T02:27:15ZHow can i assign certain length for each column of exported text file? Hi,
I am trying to write a 8680*18 cell array in to a text file. But i need to assign certain defferent lenght for elements in each column (i.e. all elements in first have 3 characters and all elements in the second column have 12 characters, etc). can anyone help?
Thank youJosephhttps://nl.mathworks.com/matlabcentral/profile/authors/5704329-josephtag:nl.mathworks.com,2005:Question/4724322019-07-19T02:01:02Z2019-07-19T02:24:47Zset default font in all figureshow can I set default font in all figures from Helvetica to Times New Roman?Jiajun Wuhttps://nl.mathworks.com/matlabcentral/profile/authors/13808369-jiajun-wutag:nl.mathworks.com,2005:Question/2719122016-03-07T13:51:09Z2019-07-19T02:02:44ZRotate ylabel and keep centeredHi,
Is there anyway to rotate the ylabel on a plot and ensure that the label is still centered on the axis?
Using
set(get(gca,'YLabel'),'Rotation',0)
I find that the label is 'shifted up' the y-axis after rotation.
Any help would be great.
Thanks.pxg882https://nl.mathworks.com/matlabcentral/profile/authors/3793236-pxg882tag:nl.mathworks.com,2005:Question/4724202019-07-18T21:55:06Z2019-07-19T01:30:18ZRandom assignments through the use of a MatLab programmed CalenderSo my job on campus is being a Resient Assistant. Part of the job I have to do is assign my fellow RA's to a duty day.
My project that I am wanting to do is to create an academic (semesterly) calender, and then on Sunday-Wednesday I want to randomly assign two RA's, Thursdays two RA's and Friday-Saturday two RA's but I want these to all be equally split, and to be able to have certain days blacked out that they request off (i.e. if I request the second weekend of November off, the first Monday of every month, and the third Thursday in September off, the assignments would not put me on those days). I know this seems like a big task but I was wondering how I would do this, or if you could help me create these situations (even if on a smaller scale and I just increase it from there). I know some sort of "if,then,else" statements would be needed but I was hoping that you all could help. The reasoning the split up the days like this is that the Sun-Wed are our least busy days while Thur are our busiest and then Fri-Sat are 24 hour shifts and so those are the longest days. Any help or precode that you could help provide would be greatly appreciated.Alexander Mullisonhttps://nl.mathworks.com/matlabcentral/profile/authors/15829730-alexander-mullisontag:nl.mathworks.com,2005:Question/4445202019-02-12T11:21:31Z2019-07-19T01:22:00ZSuporting USRP X310Hello,
Is Matlab supporting USRP X310 with the UBX16 daughter board?Sarah Cheraghinavhttps://nl.mathworks.com/matlabcentral/profile/authors/11966271-sarah-cheraghinavtag:nl.mathworks.com,2005:Question/4724292019-07-19T01:18:36Z2019-07-19T01:20:04ZActiveX compatibility problems in Matlab GUIDE applicationHi.
I have an ActiveX compatibility problem with a program created using the Matlab GUIDE application.
This ActiveX is a 32bit based program.
Since it was a program made at the time when Matlab was a 32bit-based program, there was no program compatibility problem in the past.
But as Matlab upgrade to 64 bit, we have the problem of 32bit based ActiveX is not working in 64bit based on Matlab.
I registered the ActiveX on 64bit by using the register function in windows, but I could not find the corresponding ActiveX in the ActiveX list recognized on Matlab.
In conclusion, I wonder if there is no way to force 32-bit based ActiveX to 64bit based Matlab program without creating new ActiveX.
I would appreciate it if your answer could be of little help.
Thank you.
GyeongUk Janghttps://nl.mathworks.com/matlabcentral/profile/authors/14968465-gyeonguk-jangtag:nl.mathworks.com,2005:Question/4086572018-07-03T23:58:50Z2019-07-19T01:19:05ZWhich Toolbox is phase() in I have been using the trial version of matlab for the past month, however I recently bought the student version and while running my code I got the error
Undefined function or variable 'phase'.
Here are the following toolboxes I have installed (see after running "ver" command)
MATLAB Version 9.4 (R2018a)
Simulink Version 9.1 (R2018a)
Control System Toolbox Version 10.4 (R2018a)
DSP System Toolbox Version 9.6 (R2018a)
Image Processing Toolbox Version 10.2 (R2018a)
Instrument Control Toolbox Version 3.13 (R2018a)
Optimization Toolbox Version 8.1 (R2018a)
Signal Processing Toolbox Version 8.0 (R2018a)
Simulink Control Design Version 5.1 (R2018a)
Statistics and Machine Learning Toolbox Version 11.3 (R2018a)
Symbolic Math Toolbox Version 8.1 (R2018a)
Which toolbox do I need to get for the phase() function to work?
ThanksSreehari Ram Mohanhttps://nl.mathworks.com/matlabcentral/profile/authors/9858558-sreehari-ram-mohantag:nl.mathworks.com,2005:Question/4723712019-07-18T15:00:10Z2019-07-19T01:18:40ZImage processing removal of noise spikesI have many different images obtained from radar observations that all have the same type of noise spikes that need removed and filled in with reasonable data. I have tried to remove the noise using laplace operator and then fill in the noise using inpainting and inward interpolation methods. This works okay but the filled in data is very blurry and I want it to be better. I would really appreciate any other methods to try to remove or fill in the removed data better. I specified in one image the noise that needs removed. Notice most of them have the same struture. The important data that needs kept is the "milky" looking data behing the nose. Thank youGrant Dennanyhttps://nl.mathworks.com/matlabcentral/profile/authors/11857448-grant-dennanytag:nl.mathworks.com,2005:Question/1251642014-04-09T04:00:00Z2019-07-19T01:16:07ZWhy does matlabpool take a long time to open?While everything seems to work fine and validation completes, for some reason matlabpool takes a very long time to open. Is there a fix for this?
MathWorks Support Teamhttps://nl.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:nl.mathworks.com,2005:Question/2603102015-12-14T20:39:05Z2019-07-19T01:12:20ZH.265/HEVC support in Matlab 2015?I have a H.265 encoded video. He can use it and put processes in matlab?medic911https://nl.mathworks.com/matlabcentral/profile/authors/7171376-medic911tag:nl.mathworks.com,2005:Question/4190362018-09-13T04:00:00Z2019-07-19T00:59:21ZWhat happened to the figure toolbar in R2018b? Why is it an axes toolbar? How can I put the buttons back?In R2018b, tools such as the zoom, pan, datatip, etc are no longer at the toolbar at the top of the figure window. These buttons are now in an "axes" toolbar and only appear when you hover your mouse over the plot. How do I put the buttons back at the top of the figure window?
<<http://www.mathworks.com/matlabcentral/answers/uploaded_files/142593/b53c2d62f5bb995fe63fe61cf81eaf86.png>>
MathWorks Support Teamhttps://nl.mathworks.com/matlabcentral/profile/authors/4622813-mathworks-support-teamtag:nl.mathworks.com,2005:Question/4724182019-07-18T21:28:46Z2019-07-19T00:55:45ZPlotting legend as a separate figureHi there,
I currently have plotted something using MATLAB and I would like to plot the legend for this first graph as a separate figure. I thought adding "figure" prior to the legend command would solve this problem but it unfortunately didn't.Dinal Jayasekerahttps://nl.mathworks.com/matlabcentral/profile/authors/11099792-dinal-jayasekeratag:nl.mathworks.com,2005:Question/4724272019-07-19T00:55:10Z2019-07-19T00:55:10Zx-axes are not coincident using multiple axesI am using multipe axes using the code below. The top x-axis is not coincident as shown in attached file.
ax2=axes('xaxislocation','top','yaxislocation','right','color','none', 'xscale', 'log', 'yscale', 'log');
Mos_badhttps://nl.mathworks.com/matlabcentral/profile/authors/10910667-mos_badtag:nl.mathworks.com,2005:Question/4724262019-07-19T00:34:41Z2019-07-19T00:34:41ZSaving images into various foldersI am working on image clustering. My algorithm reads the image set from my system into MATLAB and segregates them into different clusters based on my criteria. At the end of the algorithm I have different cluster numbers with their image index content. I was wondering if I could use some function which saves those image according to the clusters in my local machine. For example, if I have image (1,2,3,5) in cluster 1 and image (4,7) in cluster 2 then I should have two folders in my working directory named Cluster1 with image 1 2 3 5 and Cluster 2 with image 4 7.
Please let me know if this could be achieved. Thank you in advance. Abhishek Singhhttps://nl.mathworks.com/matlabcentral/profile/authors/13914225-abhishek-singh