Tag Archives: matlab
Why do I get the error “Unable to process your request” when trying to sign in to a MathWorks Account via SSO?
Previously I was able to sign in to my MathWorks account using a password, but now when I try to sign in I am redirected to my university’s Single Sign-On (SSO) page and when I sign in there, I get the error "Unable to process your request. If this problem persists, contact support."Previously I was able to sign in to my MathWorks account using a password, but now when I try to sign in I am redirected to my university’s Single Sign-On (SSO) page and when I sign in there, I get the error "Unable to process your request. If this problem persists, contact support." Previously I was able to sign in to my MathWorks account using a password, but now when I try to sign in I am redirected to my university’s Single Sign-On (SSO) page and when I sign in there, I get the error "Unable to process your request. If this problem persists, contact support." MATLAB Answers — New Questions
Neumann boundary condition in a diagonal matrix
I am trying to increase the accuracy of my mode solver by reducing the size of the calculation space, to do that I apply Dirichlet and Neumann on the borders. Assuming the symmetry, solving for only the upper left side (picture below) gives me the whole field. So I apply Dirichlet on the right and top side and Neumann on the bottom and right side.
I solve with eigs the following system : where is a vector describing the whole field and is a symmetric matrix having the form :
Where b is defined as (d is the distance between two points) and a is defined as where n(xi,yi) is the value of n at the x,y position described by (i). The equation used to write the system is :
Defining Neumann Boundary condition as :
Rewriting the above equation for the bottom and left part of the field I evidence the fact that it only changes the coefficient a by a coefficient , so what I did is adding this coefficient to the matrix coefficient when I know it is a boundary, leading to :
if i modulo m is 0 ( for i=1,…,l*m and i=j ) it means I am on the bottom of the field so I add to the previous definition of
if i>=l*(m-1) it means I am on the right boundary of the field so I add to the previous definition of
The addition of this two condition supposedly take into account what happens on the bottom right corner adding . But there must be an issue whith the way I coded it or defined my boundaries since I do not get the same results as when I study the full field (and it is not just an accuracy issue). I plotted the difference between expected results and what I actually got below.
The code I used is as follow :
%%Function topology for DCF design
clear all
clc
format long
%stepIndex———————————————————
sizeX=10e-6;
sizeY=10e-6;
l=100;
m=100;
x=-linspace(0,sizeX,l);
y=linspace(0,sizeY,m);
d=abs(x(1)-x(2))
[xx,yy]=meshgrid(x,y);
n=zeros(size(xx));
Phi=zeros(m*l);
%%%%%%%%%%%%%%%%%%%%%%%%Iterate over wl%%%%%%%%%%%%%%%%%%%%%%%%%%
%Basic physical parameters—————————————–
lambdac=1030e-9;
dlambda=0.5e-9;
rcoreIni=5e-6;
rclad=125e-6;
nbg=1;
neff=[];
lambdac0=1000e-9;
lambdacmax=1600e-9;
psi=[];
for lambda0=lambdac0:50e-9:lambdacmax%lambdac-dlambda:dlambda:lambdac+dlambda
%n_SiO2=interp1(A(:,1)*1e-9,A(:,9),lambda0,’spline’); %-replaced because the Sellmeier filed is not attached and the issue is generalized to every wavelength
wl=lambdac0;
A1=0.6961663;
A2=0.4079426;
A3=0.8974794;
L1=0.0684043e-6;
L2=0.1162414e-6;
L3=9.896161e-6;
n_SiO2=sqrt(1+(A1*wl^2)/(wl^2-L1^2)+(A2*wl^2)/(wl^2-L2^2)+(A3*wl^2)/(wl^2-L3^2));
k0=2*pi/lambda0;
lambda0
%Initial design guess———————————————-
nmin=n_SiO2;
nmax=sqrt(0.14^2+n_SiO2^2);
nicore=nmax;%n_SiO2+0.36*n_SiO2;%n_SiO2+0.38;
niclad=nmin;%n_SiO2;
n=n*0+nbg;
n(xx.^2+yy.^2<rclad^2)=niclad;
n(xx.^2+yy.^2<rcoreIni^2)=nicore;
figure(1);
surf(xx,yy,n,’EdgeColor’,’none’);axis tight
%transform n———————————————————–
ni=[];
for iii=1:1:length(n)
ni=[ni;n(iii,:).’];
end
for ii=1:1:l*m
Phi(ii,ii)=-4/d^2+ni(ii)^2*k0^2;
if(ii-1>=1 && ii+1<=l*m)
Phi(ii-1,ii)=1/d^2;
Phi(ii,ii+1)=1/d^2;
Phi(ii+1,ii)=1/d^2;
Phi(ii,ii-1)=1/d^2;
end
if(ii-m>=1)
Phi(ii,ii-m)=1/d^2;
end
if(ii+m<=l*m)
Phi(ii,ii+m)=1/d^2;
end
if(ii>=l*(m-1))%right hand side
Phi(ii,ii)=Phi(ii,ii)+1/d^2;
end
if(mod(ii,m)==0)%bottom side
Phi(ii,ii)=Phi(ii,ii)+1/d^2;
end
end
%%Eigenvalues calc————————————————–
Phi=sparse(Phi);
%%solving
opts.maxit = 1000;
opts.tol = 1e-9;
[eigenvector,eigenvalues,flag]=eigs(Phi,10,(1.45)^2*k0^2,opts);
beta2=diag(eigenvalues);
Psi=eigenvector;
neff=[neff max(sqrt(beta2)./k0)];
psi=[psi Psi(:,1)];
end
%mode field visual——————————————————-
for iii=1:1:5
Pssi=[];
for jj=1:1:l
Pssi=[Pssi; Psi((jj-1)*l+1:jj*l,iii).’];
end
figure(iii+2);
surf(xx,yy,abs(Pssi).^2,’EdgeColor’,’none’);view(2);
end
lm=lambdac0:50e-9:lambdacmax;
figure(2)
hold on
plot(lm,neff);
hold off
Am I wrong code wise, theory wise or both??
Thanks a lot!I am trying to increase the accuracy of my mode solver by reducing the size of the calculation space, to do that I apply Dirichlet and Neumann on the borders. Assuming the symmetry, solving for only the upper left side (picture below) gives me the whole field. So I apply Dirichlet on the right and top side and Neumann on the bottom and right side.
I solve with eigs the following system : where is a vector describing the whole field and is a symmetric matrix having the form :
Where b is defined as (d is the distance between two points) and a is defined as where n(xi,yi) is the value of n at the x,y position described by (i). The equation used to write the system is :
Defining Neumann Boundary condition as :
Rewriting the above equation for the bottom and left part of the field I evidence the fact that it only changes the coefficient a by a coefficient , so what I did is adding this coefficient to the matrix coefficient when I know it is a boundary, leading to :
if i modulo m is 0 ( for i=1,…,l*m and i=j ) it means I am on the bottom of the field so I add to the previous definition of
if i>=l*(m-1) it means I am on the right boundary of the field so I add to the previous definition of
The addition of this two condition supposedly take into account what happens on the bottom right corner adding . But there must be an issue whith the way I coded it or defined my boundaries since I do not get the same results as when I study the full field (and it is not just an accuracy issue). I plotted the difference between expected results and what I actually got below.
The code I used is as follow :
%%Function topology for DCF design
clear all
clc
format long
%stepIndex———————————————————
sizeX=10e-6;
sizeY=10e-6;
l=100;
m=100;
x=-linspace(0,sizeX,l);
y=linspace(0,sizeY,m);
d=abs(x(1)-x(2))
[xx,yy]=meshgrid(x,y);
n=zeros(size(xx));
Phi=zeros(m*l);
%%%%%%%%%%%%%%%%%%%%%%%%Iterate over wl%%%%%%%%%%%%%%%%%%%%%%%%%%
%Basic physical parameters—————————————–
lambdac=1030e-9;
dlambda=0.5e-9;
rcoreIni=5e-6;
rclad=125e-6;
nbg=1;
neff=[];
lambdac0=1000e-9;
lambdacmax=1600e-9;
psi=[];
for lambda0=lambdac0:50e-9:lambdacmax%lambdac-dlambda:dlambda:lambdac+dlambda
%n_SiO2=interp1(A(:,1)*1e-9,A(:,9),lambda0,’spline’); %-replaced because the Sellmeier filed is not attached and the issue is generalized to every wavelength
wl=lambdac0;
A1=0.6961663;
A2=0.4079426;
A3=0.8974794;
L1=0.0684043e-6;
L2=0.1162414e-6;
L3=9.896161e-6;
n_SiO2=sqrt(1+(A1*wl^2)/(wl^2-L1^2)+(A2*wl^2)/(wl^2-L2^2)+(A3*wl^2)/(wl^2-L3^2));
k0=2*pi/lambda0;
lambda0
%Initial design guess———————————————-
nmin=n_SiO2;
nmax=sqrt(0.14^2+n_SiO2^2);
nicore=nmax;%n_SiO2+0.36*n_SiO2;%n_SiO2+0.38;
niclad=nmin;%n_SiO2;
n=n*0+nbg;
n(xx.^2+yy.^2<rclad^2)=niclad;
n(xx.^2+yy.^2<rcoreIni^2)=nicore;
figure(1);
surf(xx,yy,n,’EdgeColor’,’none’);axis tight
%transform n———————————————————–
ni=[];
for iii=1:1:length(n)
ni=[ni;n(iii,:).’];
end
for ii=1:1:l*m
Phi(ii,ii)=-4/d^2+ni(ii)^2*k0^2;
if(ii-1>=1 && ii+1<=l*m)
Phi(ii-1,ii)=1/d^2;
Phi(ii,ii+1)=1/d^2;
Phi(ii+1,ii)=1/d^2;
Phi(ii,ii-1)=1/d^2;
end
if(ii-m>=1)
Phi(ii,ii-m)=1/d^2;
end
if(ii+m<=l*m)
Phi(ii,ii+m)=1/d^2;
end
if(ii>=l*(m-1))%right hand side
Phi(ii,ii)=Phi(ii,ii)+1/d^2;
end
if(mod(ii,m)==0)%bottom side
Phi(ii,ii)=Phi(ii,ii)+1/d^2;
end
end
%%Eigenvalues calc————————————————–
Phi=sparse(Phi);
%%solving
opts.maxit = 1000;
opts.tol = 1e-9;
[eigenvector,eigenvalues,flag]=eigs(Phi,10,(1.45)^2*k0^2,opts);
beta2=diag(eigenvalues);
Psi=eigenvector;
neff=[neff max(sqrt(beta2)./k0)];
psi=[psi Psi(:,1)];
end
%mode field visual——————————————————-
for iii=1:1:5
Pssi=[];
for jj=1:1:l
Pssi=[Pssi; Psi((jj-1)*l+1:jj*l,iii).’];
end
figure(iii+2);
surf(xx,yy,abs(Pssi).^2,’EdgeColor’,’none’);view(2);
end
lm=lambdac0:50e-9:lambdacmax;
figure(2)
hold on
plot(lm,neff);
hold off
Am I wrong code wise, theory wise or both??
Thanks a lot! I am trying to increase the accuracy of my mode solver by reducing the size of the calculation space, to do that I apply Dirichlet and Neumann on the borders. Assuming the symmetry, solving for only the upper left side (picture below) gives me the whole field. So I apply Dirichlet on the right and top side and Neumann on the bottom and right side.
I solve with eigs the following system : where is a vector describing the whole field and is a symmetric matrix having the form :
Where b is defined as (d is the distance between two points) and a is defined as where n(xi,yi) is the value of n at the x,y position described by (i). The equation used to write the system is :
Defining Neumann Boundary condition as :
Rewriting the above equation for the bottom and left part of the field I evidence the fact that it only changes the coefficient a by a coefficient , so what I did is adding this coefficient to the matrix coefficient when I know it is a boundary, leading to :
if i modulo m is 0 ( for i=1,…,l*m and i=j ) it means I am on the bottom of the field so I add to the previous definition of
if i>=l*(m-1) it means I am on the right boundary of the field so I add to the previous definition of
The addition of this two condition supposedly take into account what happens on the bottom right corner adding . But there must be an issue whith the way I coded it or defined my boundaries since I do not get the same results as when I study the full field (and it is not just an accuracy issue). I plotted the difference between expected results and what I actually got below.
The code I used is as follow :
%%Function topology for DCF design
clear all
clc
format long
%stepIndex———————————————————
sizeX=10e-6;
sizeY=10e-6;
l=100;
m=100;
x=-linspace(0,sizeX,l);
y=linspace(0,sizeY,m);
d=abs(x(1)-x(2))
[xx,yy]=meshgrid(x,y);
n=zeros(size(xx));
Phi=zeros(m*l);
%%%%%%%%%%%%%%%%%%%%%%%%Iterate over wl%%%%%%%%%%%%%%%%%%%%%%%%%%
%Basic physical parameters—————————————–
lambdac=1030e-9;
dlambda=0.5e-9;
rcoreIni=5e-6;
rclad=125e-6;
nbg=1;
neff=[];
lambdac0=1000e-9;
lambdacmax=1600e-9;
psi=[];
for lambda0=lambdac0:50e-9:lambdacmax%lambdac-dlambda:dlambda:lambdac+dlambda
%n_SiO2=interp1(A(:,1)*1e-9,A(:,9),lambda0,’spline’); %-replaced because the Sellmeier filed is not attached and the issue is generalized to every wavelength
wl=lambdac0;
A1=0.6961663;
A2=0.4079426;
A3=0.8974794;
L1=0.0684043e-6;
L2=0.1162414e-6;
L3=9.896161e-6;
n_SiO2=sqrt(1+(A1*wl^2)/(wl^2-L1^2)+(A2*wl^2)/(wl^2-L2^2)+(A3*wl^2)/(wl^2-L3^2));
k0=2*pi/lambda0;
lambda0
%Initial design guess———————————————-
nmin=n_SiO2;
nmax=sqrt(0.14^2+n_SiO2^2);
nicore=nmax;%n_SiO2+0.36*n_SiO2;%n_SiO2+0.38;
niclad=nmin;%n_SiO2;
n=n*0+nbg;
n(xx.^2+yy.^2<rclad^2)=niclad;
n(xx.^2+yy.^2<rcoreIni^2)=nicore;
figure(1);
surf(xx,yy,n,’EdgeColor’,’none’);axis tight
%transform n———————————————————–
ni=[];
for iii=1:1:length(n)
ni=[ni;n(iii,:).’];
end
for ii=1:1:l*m
Phi(ii,ii)=-4/d^2+ni(ii)^2*k0^2;
if(ii-1>=1 && ii+1<=l*m)
Phi(ii-1,ii)=1/d^2;
Phi(ii,ii+1)=1/d^2;
Phi(ii+1,ii)=1/d^2;
Phi(ii,ii-1)=1/d^2;
end
if(ii-m>=1)
Phi(ii,ii-m)=1/d^2;
end
if(ii+m<=l*m)
Phi(ii,ii+m)=1/d^2;
end
if(ii>=l*(m-1))%right hand side
Phi(ii,ii)=Phi(ii,ii)+1/d^2;
end
if(mod(ii,m)==0)%bottom side
Phi(ii,ii)=Phi(ii,ii)+1/d^2;
end
end
%%Eigenvalues calc————————————————–
Phi=sparse(Phi);
%%solving
opts.maxit = 1000;
opts.tol = 1e-9;
[eigenvector,eigenvalues,flag]=eigs(Phi,10,(1.45)^2*k0^2,opts);
beta2=diag(eigenvalues);
Psi=eigenvector;
neff=[neff max(sqrt(beta2)./k0)];
psi=[psi Psi(:,1)];
end
%mode field visual——————————————————-
for iii=1:1:5
Pssi=[];
for jj=1:1:l
Pssi=[Pssi; Psi((jj-1)*l+1:jj*l,iii).’];
end
figure(iii+2);
surf(xx,yy,abs(Pssi).^2,’EdgeColor’,’none’);view(2);
end
lm=lambdac0:50e-9:lambdacmax;
figure(2)
hold on
plot(lm,neff);
hold off
Am I wrong code wise, theory wise or both??
Thanks a lot! neumann, matlab code MATLAB Answers — New Questions
tiledlayout(“vertical”) with multiple columns
Hi,
I want to create a figure with a tiledlayout("vertical") meaning that new rows can be added with nexttile() at a later time. However this layout should have multiple columns per row (the number of columns stays the same in each row – however I do not know how many rows will be added in the end). Do you know of a way how this is possible?
I tried nesting layouts but that didn’t work well – see following code:
ff = figure()
T=tiledlayout(ff, "vertical");
nexttile(T,[1,1]); axis off
t1=tiledlayout(T, "horizontal"); %first inner layout
nexttile(t1)
nexttile(t1)
nexttile(T); axis off
t2=tiledlayout(T, "horizontal"); %first inner layout
nexttile(t2)
Thanks a lot,
AndreasHi,
I want to create a figure with a tiledlayout("vertical") meaning that new rows can be added with nexttile() at a later time. However this layout should have multiple columns per row (the number of columns stays the same in each row – however I do not know how many rows will be added in the end). Do you know of a way how this is possible?
I tried nesting layouts but that didn’t work well – see following code:
ff = figure()
T=tiledlayout(ff, "vertical");
nexttile(T,[1,1]); axis off
t1=tiledlayout(T, "horizontal"); %first inner layout
nexttile(t1)
nexttile(t1)
nexttile(T); axis off
t2=tiledlayout(T, "horizontal"); %first inner layout
nexttile(t2)
Thanks a lot,
Andreas Hi,
I want to create a figure with a tiledlayout("vertical") meaning that new rows can be added with nexttile() at a later time. However this layout should have multiple columns per row (the number of columns stays the same in each row – however I do not know how many rows will be added in the end). Do you know of a way how this is possible?
I tried nesting layouts but that didn’t work well – see following code:
ff = figure()
T=tiledlayout(ff, "vertical");
nexttile(T,[1,1]); axis off
t1=tiledlayout(T, "horizontal"); %first inner layout
nexttile(t1)
nexttile(t1)
nexttile(T); axis off
t2=tiledlayout(T, "horizontal"); %first inner layout
nexttile(t2)
Thanks a lot,
Andreas graphics, tiledlayout MATLAB Answers — New Questions
Reading and plotting STL File
I’m trying to read a .stl file and plot its triangulated surface (from scratch).
%- Let’s storage the vertices in an array.
fid = fopen(‘Silla.stl’,’r’);
regex = ‘s*vertexs*([-]?(?:[0-9]*[.])?[0-9]+)s*([-]?(?:[0-9]*[.])?[0-9]+)s*([-]?(?:[0-9]*[.])?[0-9]+)’;
line_ex = fgetl(fid);
i = 1;
j = 1;
while ~feof(fid)
line_ex = fgetl(fid);
if regexp(line_ex,regex)
toks = regexp(line_ex, regex, ‘tokens’);
%- Points
p{i,1} = str2double(toks{:}{1});
p{i,2} = str2double(toks{:}{3});
p{i,3} = str2double(toks{:}{2});
%p{i,4} = 1;
%- Counter
i = i + 1;
end
end
fclose(fid);
%- Indices.
k = 1;
for j = 1:(size(p,1)/3)
t{j,1} = k;
t{j,2} = k+1;
t{j,3} = k+2;
k = k + 3;
end
what I wanna do is plot triangle by triangle.
I’ve already tried it with trisurf, plot3 and fill3, but I have not seen results.
Any ideas?I’m trying to read a .stl file and plot its triangulated surface (from scratch).
%- Let’s storage the vertices in an array.
fid = fopen(‘Silla.stl’,’r’);
regex = ‘s*vertexs*([-]?(?:[0-9]*[.])?[0-9]+)s*([-]?(?:[0-9]*[.])?[0-9]+)s*([-]?(?:[0-9]*[.])?[0-9]+)’;
line_ex = fgetl(fid);
i = 1;
j = 1;
while ~feof(fid)
line_ex = fgetl(fid);
if regexp(line_ex,regex)
toks = regexp(line_ex, regex, ‘tokens’);
%- Points
p{i,1} = str2double(toks{:}{1});
p{i,2} = str2double(toks{:}{3});
p{i,3} = str2double(toks{:}{2});
%p{i,4} = 1;
%- Counter
i = i + 1;
end
end
fclose(fid);
%- Indices.
k = 1;
for j = 1:(size(p,1)/3)
t{j,1} = k;
t{j,2} = k+1;
t{j,3} = k+2;
k = k + 3;
end
what I wanna do is plot triangle by triangle.
I’ve already tried it with trisurf, plot3 and fill3, but I have not seen results.
Any ideas? I’m trying to read a .stl file and plot its triangulated surface (from scratch).
%- Let’s storage the vertices in an array.
fid = fopen(‘Silla.stl’,’r’);
regex = ‘s*vertexs*([-]?(?:[0-9]*[.])?[0-9]+)s*([-]?(?:[0-9]*[.])?[0-9]+)s*([-]?(?:[0-9]*[.])?[0-9]+)’;
line_ex = fgetl(fid);
i = 1;
j = 1;
while ~feof(fid)
line_ex = fgetl(fid);
if regexp(line_ex,regex)
toks = regexp(line_ex, regex, ‘tokens’);
%- Points
p{i,1} = str2double(toks{:}{1});
p{i,2} = str2double(toks{:}{3});
p{i,3} = str2double(toks{:}{2});
%p{i,4} = 1;
%- Counter
i = i + 1;
end
end
fclose(fid);
%- Indices.
k = 1;
for j = 1:(size(p,1)/3)
t{j,1} = k;
t{j,2} = k+1;
t{j,3} = k+2;
k = k + 3;
end
what I wanna do is plot triangle by triangle.
I’ve already tried it with trisurf, plot3 and fill3, but I have not seen results.
Any ideas? stl MATLAB Answers — New Questions
Where is my License?
I have bought a license for MATLAB, Deep Learning Toolbox, Parallel Computing Toolbox, Statistics and Machine Learning Toolbox in 20 january 2022. But now I don’t see a license in my account.
License type is Home | Individual | PerpetualI have bought a license for MATLAB, Deep Learning Toolbox, Parallel Computing Toolbox, Statistics and Machine Learning Toolbox in 20 january 2022. But now I don’t see a license in my account.
License type is Home | Individual | Perpetual I have bought a license for MATLAB, Deep Learning Toolbox, Parallel Computing Toolbox, Statistics and Machine Learning Toolbox in 20 january 2022. But now I don’t see a license in my account.
License type is Home | Individual | Perpetual license MATLAB Answers — New Questions
Measuring Line Profiles in IMages
I have a image such as below which has horizontal and vertical lines in the field of view. I want to segment the vertical line adjacent to the dark area such as in red below and vertical line in the intersection of the horizontal line(as seen in black).The full image has many such structiures. I want to stack all similar segmented structures within the fov (Average measuremnet of red and black) and display.I also want to measure the average x and y as shown below if the red line concaves at the max conving location in y.I have a image such as below which has horizontal and vertical lines in the field of view. I want to segment the vertical line adjacent to the dark area such as in red below and vertical line in the intersection of the horizontal line(as seen in black).The full image has many such structiures. I want to stack all similar segmented structures within the fov (Average measuremnet of red and black) and display.I also want to measure the average x and y as shown below if the red line concaves at the max conving location in y. I have a image such as below which has horizontal and vertical lines in the field of view. I want to segment the vertical line adjacent to the dark area such as in red below and vertical line in the intersection of the horizontal line(as seen in black).The full image has many such structiures. I want to stack all similar segmented structures within the fov (Average measuremnet of red and black) and display.I also want to measure the average x and y as shown below if the red line concaves at the max conving location in y. image segmentation, image processing MATLAB Answers — New Questions
Please provide me the matlab code for 8-bit integer arithmetic coding and decoding.
I am currently using 8-bit integer arithmetic encoding to compress a binary vector of approximately 7000 bits in MATLAB. However, after decoding the arithmetic encoding, the reconstructed binary vector does not match the original input. Could you please provide MATLAB code for 8-bit integer arithmetic encoding and decoding that ensures full recovery of the original data?I am currently using 8-bit integer arithmetic encoding to compress a binary vector of approximately 7000 bits in MATLAB. However, after decoding the arithmetic encoding, the reconstructed binary vector does not match the original input. Could you please provide MATLAB code for 8-bit integer arithmetic encoding and decoding that ensures full recovery of the original data? I am currently using 8-bit integer arithmetic encoding to compress a binary vector of approximately 7000 bits in MATLAB. However, after decoding the arithmetic encoding, the reconstructed binary vector does not match the original input. Could you please provide MATLAB code for 8-bit integer arithmetic encoding and decoding that ensures full recovery of the original data? 8-bit integer arithmetic coding MATLAB Answers — New Questions
Strange behaviour using double
I’m currently using Matlab 2020b
The doumentation for the double function states that ‘Converting a string that does not represent a single numeric value to double will produce a NaN result’. Based on this, I am using isnan(double(string(‘chars’))) to check whether a user inputted character vector represents a number or not. One particular case I wish to guard against is users entering a ‘,’ instaed of ‘.’. This works very well, except if the vector in question has a comma followed by exactly 3 numerals, in which case double tells me it is a number. For example, the vector ‘1.23’ will produce NaN, but ‘1,234’ gives the number 1234. Any other number of characters after the comma gives NaN (as far as I can tell).
Does anybody understand why this is and is there a way to get it to do what I actually want?
ThanksI’m currently using Matlab 2020b
The doumentation for the double function states that ‘Converting a string that does not represent a single numeric value to double will produce a NaN result’. Based on this, I am using isnan(double(string(‘chars’))) to check whether a user inputted character vector represents a number or not. One particular case I wish to guard against is users entering a ‘,’ instaed of ‘.’. This works very well, except if the vector in question has a comma followed by exactly 3 numerals, in which case double tells me it is a number. For example, the vector ‘1.23’ will produce NaN, but ‘1,234’ gives the number 1234. Any other number of characters after the comma gives NaN (as far as I can tell).
Does anybody understand why this is and is there a way to get it to do what I actually want?
Thanks I’m currently using Matlab 2020b
The doumentation for the double function states that ‘Converting a string that does not represent a single numeric value to double will produce a NaN result’. Based on this, I am using isnan(double(string(‘chars’))) to check whether a user inputted character vector represents a number or not. One particular case I wish to guard against is users entering a ‘,’ instaed of ‘.’. This works very well, except if the vector in question has a comma followed by exactly 3 numerals, in which case double tells me it is a number. For example, the vector ‘1.23’ will produce NaN, but ‘1,234’ gives the number 1234. Any other number of characters after the comma gives NaN (as far as I can tell).
Does anybody understand why this is and is there a way to get it to do what I actually want?
Thanks double MATLAB Answers — New Questions
Issues creating error bar for bar figure
Hi,
I’m trying to create error bars on my bar plot.
I get the error: "Input arguments must be numeric, datetime, duration, or categorical."
I’m not sure what I’m doing wrong. Even when I make err equal to two numbers it still doesn’t work.
AMean = 656631
BMean = 1130
ASTD = 237027
BSTD = 209
AHeight = 10
BHeight = 11
Names = ["A"; "B" ] ;
Averages = [AMean; BMean] ;
StandDev = [ASTD ; BSTD] ;
SampSize = [AHeight; BHeight] ;
NewTable = table(Names, Averages, StandDev, SampSize) ;
x = NewTable.Names ;
y = NewTable.Averages ;
err = StandDev ./ sqrt(SampSize) ;
bar(x, y)
errorbar(x,y,err)Hi,
I’m trying to create error bars on my bar plot.
I get the error: "Input arguments must be numeric, datetime, duration, or categorical."
I’m not sure what I’m doing wrong. Even when I make err equal to two numbers it still doesn’t work.
AMean = 656631
BMean = 1130
ASTD = 237027
BSTD = 209
AHeight = 10
BHeight = 11
Names = ["A"; "B" ] ;
Averages = [AMean; BMean] ;
StandDev = [ASTD ; BSTD] ;
SampSize = [AHeight; BHeight] ;
NewTable = table(Names, Averages, StandDev, SampSize) ;
x = NewTable.Names ;
y = NewTable.Averages ;
err = StandDev ./ sqrt(SampSize) ;
bar(x, y)
errorbar(x,y,err) Hi,
I’m trying to create error bars on my bar plot.
I get the error: "Input arguments must be numeric, datetime, duration, or categorical."
I’m not sure what I’m doing wrong. Even when I make err equal to two numbers it still doesn’t work.
AMean = 656631
BMean = 1130
ASTD = 237027
BSTD = 209
AHeight = 10
BHeight = 11
Names = ["A"; "B" ] ;
Averages = [AMean; BMean] ;
StandDev = [ASTD ; BSTD] ;
SampSize = [AHeight; BHeight] ;
NewTable = table(Names, Averages, StandDev, SampSize) ;
x = NewTable.Names ;
y = NewTable.Averages ;
err = StandDev ./ sqrt(SampSize) ;
bar(x, y)
errorbar(x,y,err) error bar, graphing MATLAB Answers — New Questions
startRecording() not reliable in real-time app? New file logs not being created when expected
I used this Mathworks post to implement an intermittent file logging method in my real-time app running on Speedgoat.
I created a long duration (10’s on minutes) timer with a callback. The callback performs stopRecording() and then startRecording(), which should create a new log file.
The timer looks something like this:
timer(‘ExecutionMode’, ‘fixedRate’, ‘Period’, 600, ‘TimerFcn’, @(~,~)app.createNewLogFile(app))
createNewLogFile() does the following:
stopRecording(app.tg)
short pause()
startRecording(app.tg)
Checks whether a new log file was created (it should be from stopping/restarting)
This works the majority of the time, but fails intermittently. I performed basic troubleshooting to see that it fails to log for a period of time when the callback fails. I can see that it stopped recording but did not restart within that failed callback.
Extra info:
There is no Enable Log File block in the model because its documentation page says that it can affect the usage of recording functions
I have tried giving the stop/restart calls multiple attempts within the same timer callback. It seems that if it fails the first attempt in a timer callback, it fails repeatedly within that callback
I want the timed log functionality to be in the App because I want the ability for an App user to toggle it. Meaning that in-model default timer solutions don’t work as an alternative
I would like to learn how to fish here. What can I do to truly understand why/how a startRecording() call would not work? Is there something about housing this behavior within a timer callback on the host side that makes it unreliable for sending commands to the target? It doesn’t seem like it should be since the timer is very long duration in comparison to the callback commands.
If I understand the documentation correctly, there is a target->host ACK built in to the stopRecording() and startRecording() functions? So I would expect the restart to fail the acknowledge step if it did not go through. But I don’t see a failure.
Thanks for any insight here.I used this Mathworks post to implement an intermittent file logging method in my real-time app running on Speedgoat.
I created a long duration (10’s on minutes) timer with a callback. The callback performs stopRecording() and then startRecording(), which should create a new log file.
The timer looks something like this:
timer(‘ExecutionMode’, ‘fixedRate’, ‘Period’, 600, ‘TimerFcn’, @(~,~)app.createNewLogFile(app))
createNewLogFile() does the following:
stopRecording(app.tg)
short pause()
startRecording(app.tg)
Checks whether a new log file was created (it should be from stopping/restarting)
This works the majority of the time, but fails intermittently. I performed basic troubleshooting to see that it fails to log for a period of time when the callback fails. I can see that it stopped recording but did not restart within that failed callback.
Extra info:
There is no Enable Log File block in the model because its documentation page says that it can affect the usage of recording functions
I have tried giving the stop/restart calls multiple attempts within the same timer callback. It seems that if it fails the first attempt in a timer callback, it fails repeatedly within that callback
I want the timed log functionality to be in the App because I want the ability for an App user to toggle it. Meaning that in-model default timer solutions don’t work as an alternative
I would like to learn how to fish here. What can I do to truly understand why/how a startRecording() call would not work? Is there something about housing this behavior within a timer callback on the host side that makes it unreliable for sending commands to the target? It doesn’t seem like it should be since the timer is very long duration in comparison to the callback commands.
If I understand the documentation correctly, there is a target->host ACK built in to the stopRecording() and startRecording() functions? So I would expect the restart to fail the acknowledge step if it did not go through. But I don’t see a failure.
Thanks for any insight here. I used this Mathworks post to implement an intermittent file logging method in my real-time app running on Speedgoat.
I created a long duration (10’s on minutes) timer with a callback. The callback performs stopRecording() and then startRecording(), which should create a new log file.
The timer looks something like this:
timer(‘ExecutionMode’, ‘fixedRate’, ‘Period’, 600, ‘TimerFcn’, @(~,~)app.createNewLogFile(app))
createNewLogFile() does the following:
stopRecording(app.tg)
short pause()
startRecording(app.tg)
Checks whether a new log file was created (it should be from stopping/restarting)
This works the majority of the time, but fails intermittently. I performed basic troubleshooting to see that it fails to log for a period of time when the callback fails. I can see that it stopped recording but did not restart within that failed callback.
Extra info:
There is no Enable Log File block in the model because its documentation page says that it can affect the usage of recording functions
I have tried giving the stop/restart calls multiple attempts within the same timer callback. It seems that if it fails the first attempt in a timer callback, it fails repeatedly within that callback
I want the timed log functionality to be in the App because I want the ability for an App user to toggle it. Meaning that in-model default timer solutions don’t work as an alternative
I would like to learn how to fish here. What can I do to truly understand why/how a startRecording() call would not work? Is there something about housing this behavior within a timer callback on the host side that makes it unreliable for sending commands to the target? It doesn’t seem like it should be since the timer is very long duration in comparison to the callback commands.
If I understand the documentation correctly, there is a target->host ACK built in to the stopRecording() and startRecording() functions? So I would expect the restart to fail the acknowledge step if it did not go through. But I don’t see a failure.
Thanks for any insight here. app designer, timer, real-time MATLAB Answers — New Questions
unable to open timetables from workspace
Hello Matlab Comminity,
I have just updated my MATLAB to R2025a and I can not open the timetables from my workspace.
Other variables (numeric arrays, tables, timerange objects) open fine. With timetables, the workspace either becomes unresponsive or never shows the variable. No explicit error dialog appears.If I write the variable to command window, I can see the content but it is not what I need.
It seems like a strange error or unresponsive and i do not know how to fix this.
Is there any idea to remove this trouble?
Thank you in advance for your time.Hello Matlab Comminity,
I have just updated my MATLAB to R2025a and I can not open the timetables from my workspace.
Other variables (numeric arrays, tables, timerange objects) open fine. With timetables, the workspace either becomes unresponsive or never shows the variable. No explicit error dialog appears.If I write the variable to command window, I can see the content but it is not what I need.
It seems like a strange error or unresponsive and i do not know how to fix this.
Is there any idea to remove this trouble?
Thank you in advance for your time. Hello Matlab Comminity,
I have just updated my MATLAB to R2025a and I can not open the timetables from my workspace.
Other variables (numeric arrays, tables, timerange objects) open fine. With timetables, the workspace either becomes unresponsive or never shows the variable. No explicit error dialog appears.If I write the variable to command window, I can see the content but it is not what I need.
It seems like a strange error or unresponsive and i do not know how to fix this.
Is there any idea to remove this trouble?
Thank you in advance for your time. workspace, timetable MATLAB Answers — New Questions
Compare two row and select appropriate data
I have two columns. Let’s call them column a and column b.
I want to do a check where:
if row 1 of column a > row 1 of column b, use row 1 of column a. Else, use row 1 of column b.
I have tried
if Column a > Column b
Column c = column b
else
Column c = column a
end
However, when I check the data, I find out some of the function isn’t working and it just pulls all the data from column a into column c.
Basically column b is the "cap." And no number in column c should be greater than that. If any numbers in column a is greater than column b, column b should be used.I have two columns. Let’s call them column a and column b.
I want to do a check where:
if row 1 of column a > row 1 of column b, use row 1 of column a. Else, use row 1 of column b.
I have tried
if Column a > Column b
Column c = column b
else
Column c = column a
end
However, when I check the data, I find out some of the function isn’t working and it just pulls all the data from column a into column c.
Basically column b is the "cap." And no number in column c should be greater than that. If any numbers in column a is greater than column b, column b should be used. I have two columns. Let’s call them column a and column b.
I want to do a check where:
if row 1 of column a > row 1 of column b, use row 1 of column a. Else, use row 1 of column b.
I have tried
if Column a > Column b
Column c = column b
else
Column c = column a
end
However, when I check the data, I find out some of the function isn’t working and it just pulls all the data from column a into column c.
Basically column b is the "cap." And no number in column c should be greater than that. If any numbers in column a is greater than column b, column b should be used. comparison, matlab MATLAB Answers — New Questions
How can I solve a problem that is related to Fuzzy Logic Designer
Hi… I have designed a fuzzy controller that I want to tune. The dataset I currently have contains output from another software, recorded over time. Consider that I read two inputs and generate an output, and the resulting table provides data over a 60-second period. How can I import this dataset into MATLAB and use it for tuning my fuzzy controller?
Fuzzy Controller designed in Fuzzy Logic Designer app:
Data sample:Hi… I have designed a fuzzy controller that I want to tune. The dataset I currently have contains output from another software, recorded over time. Consider that I read two inputs and generate an output, and the resulting table provides data over a 60-second period. How can I import this dataset into MATLAB and use it for tuning my fuzzy controller?
Fuzzy Controller designed in Fuzzy Logic Designer app:
Data sample: Hi… I have designed a fuzzy controller that I want to tune. The dataset I currently have contains output from another software, recorded over time. Consider that I read two inputs and generate an output, and the resulting table provides data over a 60-second period. How can I import this dataset into MATLAB and use it for tuning my fuzzy controller?
Fuzzy Controller designed in Fuzzy Logic Designer app:
Data sample: fuzzy logic controller, fuzzy logic designer MATLAB Answers — New Questions
How to add two columns based on conditions
I was going to try to write a very basic loop (to familiarize myself with writing loops), otherwise not using a loop would probably cost less.
I have a large matrix, but for simplicity, I am trying to add 2 columns together and create the sum in another column in the same matrix.
I want to have two conditions to be met in order for the addition to take place, if conditions are not met, then do not combine values, but still generate the first value.
So I want to add column 3 and 4, if column 1 x<1.5 and if column 2 x==0, then insert into column 5. If the critieria is not met, then copy value from column 3 into 5.
1 0 1 4 5
2 0 1 5 1
1 1.5 2 1 2
if intrun(:,1)<1.50) & (intrun(:,2)==0;
intrun(:,5)= intrun(:,3)+intrun(:,4);
end
Thank YouI was going to try to write a very basic loop (to familiarize myself with writing loops), otherwise not using a loop would probably cost less.
I have a large matrix, but for simplicity, I am trying to add 2 columns together and create the sum in another column in the same matrix.
I want to have two conditions to be met in order for the addition to take place, if conditions are not met, then do not combine values, but still generate the first value.
So I want to add column 3 and 4, if column 1 x<1.5 and if column 2 x==0, then insert into column 5. If the critieria is not met, then copy value from column 3 into 5.
1 0 1 4 5
2 0 1 5 1
1 1.5 2 1 2
if intrun(:,1)<1.50) & (intrun(:,2)==0;
intrun(:,5)= intrun(:,3)+intrun(:,4);
end
Thank You I was going to try to write a very basic loop (to familiarize myself with writing loops), otherwise not using a loop would probably cost less.
I have a large matrix, but for simplicity, I am trying to add 2 columns together and create the sum in another column in the same matrix.
I want to have two conditions to be met in order for the addition to take place, if conditions are not met, then do not combine values, but still generate the first value.
So I want to add column 3 and 4, if column 1 x<1.5 and if column 2 x==0, then insert into column 5. If the critieria is not met, then copy value from column 3 into 5.
1 0 1 4 5
2 0 1 5 1
1 1.5 2 1 2
if intrun(:,1)<1.50) & (intrun(:,2)==0;
intrun(:,5)= intrun(:,3)+intrun(:,4);
end
Thank You for loop MATLAB Answers — New Questions
Identify exact jittered point from swarmchart plot
I created a horizontal swarmchart in app designer. The input data have numeric values and grouping tags (intGroups) associated with each point. Each point’s color is associated with its group. I also defined a ButtonDownFcn to get the point that the user clicks on (using code from a previous Matlab Answer).
The issue is that when I click a point, swarmchart’s XData and YData give the undithered coordinates (i.e., the y-values are all the same). So if I click a point that is far from center (due to a lot of points having that same value), the code below may or may not identify that point I clicked, so I may not get the correct group.
Is there a way to ensure that I get the exact point I clicked (or its index in the vector), not others that are in the same vicinity?
for zz = 1:length(intVarsUnique)
hPlot = swarmchart(axPlot, xData(:, zz), intVars(:, zz), [], categorical(strGroupColors), ‘filled’, ‘o’, …
‘YJitter’,’density’, …
‘HitTest’, ‘on’, ‘ButtonDownFcn’, @(src, eventData) fcnPlot_ButtonDown(app, src, eventData));
if ~ishold(axPlot)
hold(axPlot, ‘on’);
end
end % zz
hold(axPlot, ‘off’);
function fcnPlot_ButtonDown(app, hPlot, eventData)
% Based on code from Yair Altman in https://www.mathworks.com/matlabcentral/answers/1903190-get-data-point-that-was-clicked-on-in-graph
% Get the click coordinates from the click event data
x = eventData.IntersectionPoint(1);
y = eventData.IntersectionPoint(2);
line_xs = hPlot.XData;
line_ys = hPlot.YData;
dist2 = (x-line_xs).^2 + (y-line_ys).^2;
[~,min_idx] = min(dist2);
closest_x = line_xs(min_idx);
closest_y = line_ys(min_idx);
msgbox(sprintf(‘Clicked on: (%g,%g)nClosest pt: (%g,%g)’, x, y, closest_x, closest_y));
% Code to locate point in vector and ID group…
endI created a horizontal swarmchart in app designer. The input data have numeric values and grouping tags (intGroups) associated with each point. Each point’s color is associated with its group. I also defined a ButtonDownFcn to get the point that the user clicks on (using code from a previous Matlab Answer).
The issue is that when I click a point, swarmchart’s XData and YData give the undithered coordinates (i.e., the y-values are all the same). So if I click a point that is far from center (due to a lot of points having that same value), the code below may or may not identify that point I clicked, so I may not get the correct group.
Is there a way to ensure that I get the exact point I clicked (or its index in the vector), not others that are in the same vicinity?
for zz = 1:length(intVarsUnique)
hPlot = swarmchart(axPlot, xData(:, zz), intVars(:, zz), [], categorical(strGroupColors), ‘filled’, ‘o’, …
‘YJitter’,’density’, …
‘HitTest’, ‘on’, ‘ButtonDownFcn’, @(src, eventData) fcnPlot_ButtonDown(app, src, eventData));
if ~ishold(axPlot)
hold(axPlot, ‘on’);
end
end % zz
hold(axPlot, ‘off’);
function fcnPlot_ButtonDown(app, hPlot, eventData)
% Based on code from Yair Altman in https://www.mathworks.com/matlabcentral/answers/1903190-get-data-point-that-was-clicked-on-in-graph
% Get the click coordinates from the click event data
x = eventData.IntersectionPoint(1);
y = eventData.IntersectionPoint(2);
line_xs = hPlot.XData;
line_ys = hPlot.YData;
dist2 = (x-line_xs).^2 + (y-line_ys).^2;
[~,min_idx] = min(dist2);
closest_x = line_xs(min_idx);
closest_y = line_ys(min_idx);
msgbox(sprintf(‘Clicked on: (%g,%g)nClosest pt: (%g,%g)’, x, y, closest_x, closest_y));
% Code to locate point in vector and ID group…
end I created a horizontal swarmchart in app designer. The input data have numeric values and grouping tags (intGroups) associated with each point. Each point’s color is associated with its group. I also defined a ButtonDownFcn to get the point that the user clicks on (using code from a previous Matlab Answer).
The issue is that when I click a point, swarmchart’s XData and YData give the undithered coordinates (i.e., the y-values are all the same). So if I click a point that is far from center (due to a lot of points having that same value), the code below may or may not identify that point I clicked, so I may not get the correct group.
Is there a way to ensure that I get the exact point I clicked (or its index in the vector), not others that are in the same vicinity?
for zz = 1:length(intVarsUnique)
hPlot = swarmchart(axPlot, xData(:, zz), intVars(:, zz), [], categorical(strGroupColors), ‘filled’, ‘o’, …
‘YJitter’,’density’, …
‘HitTest’, ‘on’, ‘ButtonDownFcn’, @(src, eventData) fcnPlot_ButtonDown(app, src, eventData));
if ~ishold(axPlot)
hold(axPlot, ‘on’);
end
end % zz
hold(axPlot, ‘off’);
function fcnPlot_ButtonDown(app, hPlot, eventData)
% Based on code from Yair Altman in https://www.mathworks.com/matlabcentral/answers/1903190-get-data-point-that-was-clicked-on-in-graph
% Get the click coordinates from the click event data
x = eventData.IntersectionPoint(1);
y = eventData.IntersectionPoint(2);
line_xs = hPlot.XData;
line_ys = hPlot.YData;
dist2 = (x-line_xs).^2 + (y-line_ys).^2;
[~,min_idx] = min(dist2);
closest_x = line_xs(min_idx);
closest_y = line_ys(min_idx);
msgbox(sprintf(‘Clicked on: (%g,%g)nClosest pt: (%g,%g)’, x, y, closest_x, closest_y));
% Code to locate point in vector and ID group…
end matlab, swarmchart, appdesigner, undocumented MATLAB Answers — New Questions
Default button of “questdlg” not working in 2025a
answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,defbtn)
When the dialogue box is opened, the default button is selected, but pressing ENTER won’t click the button, and pressing ESC won’t close the dialogue box.answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,defbtn)
When the dialogue box is opened, the default button is selected, but pressing ENTER won’t click the button, and pressing ESC won’t close the dialogue box. answer = questdlg(quest,dlgtitle,btn1,btn2,btn3,defbtn)
When the dialogue box is opened, the default button is selected, but pressing ENTER won’t click the button, and pressing ESC won’t close the dialogue box. matlab gui, nevermind – works now MATLAB Answers — New Questions
start app by doubleclicking mat-file with custom extension
An application which was greated using GUIDE can save *.mat files with a cusom extension, like *.MyExtension. What I want is, that I doubleclick in the windows explorer such a file, which will:
1. open my application (probably some settings in windows)
2. pass the file path to the application, so that the data can be loaded. Can someone help me on this?An application which was greated using GUIDE can save *.mat files with a cusom extension, like *.MyExtension. What I want is, that I doubleclick in the windows explorer such a file, which will:
1. open my application (probably some settings in windows)
2. pass the file path to the application, so that the data can be loaded. Can someone help me on this? An application which was greated using GUIDE can save *.mat files with a cusom extension, like *.MyExtension. What I want is, that I doubleclick in the windows explorer such a file, which will:
1. open my application (probably some settings in windows)
2. pass the file path to the application, so that the data can be loaded. Can someone help me on this? load file in application MATLAB Answers — New Questions
Performing 2D convolution
Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you!Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you! Hello,
I am new to image processing and had a conceptual question. I am currently trying to perform a 2D convolution of an image and a kernel (filter) in simulink using the 2D convolution block. I have code that transposes the image, then flips it, then performs the 2D convolution with the kernel. However from my (very limited) understanding convolution already flips the filter that I want to apply. I was told that the output of me transposing and flipping the image, then convolving with the kernel looks correct, however from my understanding I would be transposing and flipping the image once then convolving, which involves another flip, so therefore not actually convolving? I have read that this would just produce instead a correlation?
Hoping someone who knows more may be able to help give me a better understanding.
Thank you! convolution, simulink, image processing MATLAB Answers — New Questions
Problem on startup. MacMini M4, Sequoia 15.6.1
On starup I get this meggage:
Ubable yo communicate with required MathWorks services (error 201)
Any ideas?On starup I get this meggage:
Ubable yo communicate with required MathWorks services (error 201)
Any ideas? On starup I get this meggage:
Ubable yo communicate with required MathWorks services (error 201)
Any ideas? jon’s q MATLAB Answers — New Questions
Why am I not getting printed all zones and info from one column in my table?
Here are the steps that lead to the results:
1) You start by running app2_tester that leads to app3_tester ( for making the problem simpler, I have just made it possible choosing just one combination of salts, NaCl KCl and ZnBr2: so that I don’t need to attach many function files, though there are listed up many salts in the listbox of app3_tester.
2) Each time you have pressed the choices for every zone, you press the button “done with the zone”, for instance when you in start have chosen that there are two zones, you first begin to selecting information for zone1 then do the same for zone 2
3) When you have finished pressing info about both zones, you press “ computed water activity and osmotic pressure” in app2_tester
I have problems in app2_tester and app3_tester. The other apps and some functions that are needed to run the apps are correct. I get error in app3_tester. So what I am wondering is:
Why am I not getting the zone nr 2 writtten in my osmotic table data that is printed out when I press on the button “display results from all zones”, and neither the names of the different combinations of salts in the column called combination_of_salts in my table?
The error I get says:
Error using table (line 231)
All input variables must have the same number of rows.
Error in app3_tester/StartanalysisButtonPushed (line 259)
app.Callingapp.Osmotisk_data(app.zone_now,:) = table(app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1,app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet,P,effect);Here are the steps that lead to the results:
1) You start by running app2_tester that leads to app3_tester ( for making the problem simpler, I have just made it possible choosing just one combination of salts, NaCl KCl and ZnBr2: so that I don’t need to attach many function files, though there are listed up many salts in the listbox of app3_tester.
2) Each time you have pressed the choices for every zone, you press the button “done with the zone”, for instance when you in start have chosen that there are two zones, you first begin to selecting information for zone1 then do the same for zone 2
3) When you have finished pressing info about both zones, you press “ computed water activity and osmotic pressure” in app2_tester
I have problems in app2_tester and app3_tester. The other apps and some functions that are needed to run the apps are correct. I get error in app3_tester. So what I am wondering is:
Why am I not getting the zone nr 2 writtten in my osmotic table data that is printed out when I press on the button “display results from all zones”, and neither the names of the different combinations of salts in the column called combination_of_salts in my table?
The error I get says:
Error using table (line 231)
All input variables must have the same number of rows.
Error in app3_tester/StartanalysisButtonPushed (line 259)
app.Callingapp.Osmotisk_data(app.zone_now,:) = table(app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1,app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet,P,effect); Here are the steps that lead to the results:
1) You start by running app2_tester that leads to app3_tester ( for making the problem simpler, I have just made it possible choosing just one combination of salts, NaCl KCl and ZnBr2: so that I don’t need to attach many function files, though there are listed up many salts in the listbox of app3_tester.
2) Each time you have pressed the choices for every zone, you press the button “done with the zone”, for instance when you in start have chosen that there are two zones, you first begin to selecting information for zone1 then do the same for zone 2
3) When you have finished pressing info about both zones, you press “ computed water activity and osmotic pressure” in app2_tester
I have problems in app2_tester and app3_tester. The other apps and some functions that are needed to run the apps are correct. I get error in app3_tester. So what I am wondering is:
Why am I not getting the zone nr 2 writtten in my osmotic table data that is printed out when I press on the button “display results from all zones”, and neither the names of the different combinations of salts in the column called combination_of_salts in my table?
The error I get says:
Error using table (line 231)
All input variables must have the same number of rows.
Error in app3_tester/StartanalysisButtonPushed (line 259)
app.Callingapp.Osmotisk_data(app.zone_now,:) = table(app.zone_now, app.combinations_of_salts, app.vekt_prosent_best_salt_1,app.vekt_prosent_best_salt_2, app.samlet_vannaktivitet,P,effect); appdesigner, table MATLAB Answers — New Questions









