Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab

Category: Matlab

Category Archives: Matlab

Matlab News Blog From https://blogs.mathworks.com/

How do I convert a .m with unsupported in-built MATLAB functions to C++
Matlab News

How do I convert a .m with unsupported in-built MATLAB functions to C++

PuTI / 2025-01-31

Hi everyone.
I’m currently trying to convert a MATLAB script to C++ but MATLAB Coder gives some errors saying some functions are unsupported in the code conversion.

Below are the unsupported functions
fullfile is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@ca978627

imageSet is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@36c733bd

partition is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@b1e1e753

bagOfFeatures is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@3e7efb02

encode is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@31cdf3a9

bar is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@83fd9938Hi everyone.
I’m currently trying to convert a MATLAB script to C++ but MATLAB Coder gives some errors saying some functions are unsupported in the code conversion.

Below are the unsupported functions
fullfile is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@ca978627

imageSet is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@36c733bd

partition is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@b1e1e753

bagOfFeatures is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@3e7efb02

encode is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@31cdf3a9

bar is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@83fd9938 Hi everyone.
I’m currently trying to convert a MATLAB script to C++ but MATLAB Coder gives some errors saying some functions are unsupported in the code conversion.

Below are the unsupported functions
fullfile is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@ca978627

imageSet is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@36c733bd

partition is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@b1e1e753

bagOfFeatures is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@3e7efb02

encode is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@31cdf3a9

bar is not supported for code generation
com.mathworks.toolbox.coder.screener.ScreenerError@83fd9938 matlab coder, coder, fullfile MATLAB Answers — New Questions

​

Looking for help in using structs in multiple functions
Matlab News

Looking for help in using structs in multiple functions

PuTI / 2025-01-31

I am trying to use structs, but I have no idea what a 0x1 struct is, and I am trying to add to the struct outside of a function, but I don’t understand how they work. None of the websites have a good explanation of how to use the struct. Plus, I get an error when I use the dot method to add to it.I am trying to use structs, but I have no idea what a 0x1 struct is, and I am trying to add to the struct outside of a function, but I don’t understand how they work. None of the websites have a good explanation of how to use the struct. Plus, I get an error when I use the dot method to add to it. I am trying to use structs, but I have no idea what a 0x1 struct is, and I am trying to add to the struct outside of a function, but I don’t understand how they work. None of the websites have a good explanation of how to use the struct. Plus, I get an error when I use the dot method to add to it. structs MATLAB Answers — New Questions

​

Modeling of cooling plate
Matlab News

Modeling of cooling plate

PuTI / 2025-01-31

Hello Team,
I am using simscape foundation library to model side cooling of a cylidrical cell which is represented by a thermal mass and the heat generation in each cell is represented by heat source.
There are two plates on each cell, the top plate and the bottom plate. the bottom plate is where the fluid is entering at certain flow rate, temperature and pressure. and after passing through all the bottom plates for a series of cells, the fluid enters the top plate and then exits the system.
I am currently modeling it in simscape using foundation library and not able to simulate the model, as I am not able to provide flow rate, temperatrure and pressure properly and cannot implement closed loop system.
Please help me in modeling thisHello Team,
I am using simscape foundation library to model side cooling of a cylidrical cell which is represented by a thermal mass and the heat generation in each cell is represented by heat source.
There are two plates on each cell, the top plate and the bottom plate. the bottom plate is where the fluid is entering at certain flow rate, temperature and pressure. and after passing through all the bottom plates for a series of cells, the fluid enters the top plate and then exits the system.
I am currently modeling it in simscape using foundation library and not able to simulate the model, as I am not able to provide flow rate, temperatrure and pressure properly and cannot implement closed loop system.
Please help me in modeling this Hello Team,
I am using simscape foundation library to model side cooling of a cylidrical cell which is represented by a thermal mass and the heat generation in each cell is represented by heat source.
There are two plates on each cell, the top plate and the bottom plate. the bottom plate is where the fluid is entering at certain flow rate, temperature and pressure. and after passing through all the bottom plates for a series of cells, the fluid enters the top plate and then exits the system.
I am currently modeling it in simscape using foundation library and not able to simulate the model, as I am not able to provide flow rate, temperatrure and pressure properly and cannot implement closed loop system.
Please help me in modeling this cooling plate, battery_system_management, thermal, pipe, pressure, temperature, flow rate, thermal fluid MATLAB Answers — New Questions

​

i have a problem on Enumerations data type
Matlab News

i have a problem on Enumerations data type

PuTI / 2025-01-31

how to create a script that changes the name of enumeration variables in an sldd filehow to create a script that changes the name of enumeration variables in an sldd file how to create a script that changes the name of enumeration variables in an sldd file sldd datadictionary MATLAB Answers — New Questions

​

Combining structs into one struct.
Matlab News

Combining structs into one struct.

PuTI / 2025-01-31

Hello, I have several structs that I would like to combine together into one. The issue I find is that the data for some reasons gets completely jumbled. Each time the file runs, the columns from one struct become a part of another and I cannot figure out why

CombineGLMParam(‘2_2_2’, ‘2_3_2′,’2’)
CombineGLMParam(0, ‘2_5_1′,’2’)

function CombineGLMParam(bat1,bat2,bat)
%Combine GLM parameters by putting in the bat and the file. If bat1 is not 0, open the bat1 file and create a file GLM bat.
% If it is 0, open the GLM Bat file and append the bat 2 file to GLM.

if bat1~=0
b1=load([dirf,’Bat_’,bat1,’_GLM_Params.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1)
b2=struct2cell(b2)

else
b1=load([dirf,’GLM_’,bat,’.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);

b1=struct2cell(b1.b4)
b2=struct2cell(b2)
end

for n=1:size(b2,1)

b3{n}=[b1{n}’ b2{n}’]’;

end

Header={‘ThetaX’, ‘ThetaY’, ‘ThetaZ’, ‘Td’, ‘Vd’, ‘Vw’, ‘Hd’, ‘Hw’, ‘Ld’,’Lw’};

b4=cell2struct(b3, Header, 2)

save([dirf,’GLM_’,bat,’.mat’], ‘b4’)Hello, I have several structs that I would like to combine together into one. The issue I find is that the data for some reasons gets completely jumbled. Each time the file runs, the columns from one struct become a part of another and I cannot figure out why

CombineGLMParam(‘2_2_2’, ‘2_3_2′,’2’)
CombineGLMParam(0, ‘2_5_1′,’2’)

function CombineGLMParam(bat1,bat2,bat)
%Combine GLM parameters by putting in the bat and the file. If bat1 is not 0, open the bat1 file and create a file GLM bat.
% If it is 0, open the GLM Bat file and append the bat 2 file to GLM.

if bat1~=0
b1=load([dirf,’Bat_’,bat1,’_GLM_Params.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1)
b2=struct2cell(b2)

else
b1=load([dirf,’GLM_’,bat,’.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);

b1=struct2cell(b1.b4)
b2=struct2cell(b2)
end

for n=1:size(b2,1)

b3{n}=[b1{n}’ b2{n}’]’;

end

Header={‘ThetaX’, ‘ThetaY’, ‘ThetaZ’, ‘Td’, ‘Vd’, ‘Vw’, ‘Hd’, ‘Hw’, ‘Ld’,’Lw’};

b4=cell2struct(b3, Header, 2)

save([dirf,’GLM_’,bat,’.mat’], ‘b4’) Hello, I have several structs that I would like to combine together into one. The issue I find is that the data for some reasons gets completely jumbled. Each time the file runs, the columns from one struct become a part of another and I cannot figure out why

CombineGLMParam(‘2_2_2’, ‘2_3_2′,’2’)
CombineGLMParam(0, ‘2_5_1′,’2’)

function CombineGLMParam(bat1,bat2,bat)
%Combine GLM parameters by putting in the bat and the file. If bat1 is not 0, open the bat1 file and create a file GLM bat.
% If it is 0, open the GLM Bat file and append the bat 2 file to GLM.

if bat1~=0
b1=load([dirf,’Bat_’,bat1,’_GLM_Params.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);
b1=struct2cell(b1)
b2=struct2cell(b2)

else
b1=load([dirf,’GLM_’,bat,’.mat’]);
b2=load([dirf,’Bat_’,bat2,’_GLM_Params.mat’]);

b1=struct2cell(b1.b4)
b2=struct2cell(b2)
end

for n=1:size(b2,1)

b3{n}=[b1{n}’ b2{n}’]’;

end

Header={‘ThetaX’, ‘ThetaY’, ‘ThetaZ’, ‘Td’, ‘Vd’, ‘Vw’, ‘Hd’, ‘Hw’, ‘Ld’,’Lw’};

b4=cell2struct(b3, Header, 2)

save([dirf,’GLM_’,bat,’.mat’], ‘b4’) struct, structure MATLAB Answers — New Questions

​

How to set Simulink block parameters using an absolute model path
Matlab News

How to set Simulink block parameters using an absolute model path

PuTI / 2025-01-31

I am calling a simulink model out of a MATLAB script, but this model is located in a different directory (not in the working directory).
This model can be executed by using the "sim" command in combination with the absolute path, e.g:
sim("C:UsersMATLABmyModel.slx")
Now I want to change the parameter of a "Contant" block when calling the simulation.
The functions "set_param" seems only to work with a model handle which was created by a model being in the current working path.
% name of model
mdl = "myMdl";

% name of the block
blk = "myConstBlk";

% Serch path
path = strcat(mdl, "/", blk);

% set parameter of Const
set_param(path, "Value", "5");
When performing the same action, but with an absolute path, this is not working anymore.
% name of model
mdl = "C:UsersMATLABmyModel.slx";

% name of the block
blk = "myConstBlk";

% Serch path
path = strcat(mdl, "/", blk);

% set parameter of Const
set_param(path, "Value", "5");
Invalid Simulink object name: ‘C:UsersMATLABmyMdl.slx/myConstBlk’.
Even if the model is loaded by:
h = load_system(mdl); %mdl is the absolute path
the handel "h" could not be used in the set_param function.
So therefore the qustion:
How to perform all the task provided by "set_param" and "get_param" using a model which shall be referenced by an absolute path?I am calling a simulink model out of a MATLAB script, but this model is located in a different directory (not in the working directory).
This model can be executed by using the "sim" command in combination with the absolute path, e.g:
sim("C:UsersMATLABmyModel.slx")
Now I want to change the parameter of a "Contant" block when calling the simulation.
The functions "set_param" seems only to work with a model handle which was created by a model being in the current working path.
% name of model
mdl = "myMdl";

% name of the block
blk = "myConstBlk";

% Serch path
path = strcat(mdl, "/", blk);

% set parameter of Const
set_param(path, "Value", "5");
When performing the same action, but with an absolute path, this is not working anymore.
% name of model
mdl = "C:UsersMATLABmyModel.slx";

% name of the block
blk = "myConstBlk";

% Serch path
path = strcat(mdl, "/", blk);

% set parameter of Const
set_param(path, "Value", "5");
Invalid Simulink object name: ‘C:UsersMATLABmyMdl.slx/myConstBlk’.
Even if the model is loaded by:
h = load_system(mdl); %mdl is the absolute path
the handel "h" could not be used in the set_param function.
So therefore the qustion:
How to perform all the task provided by "set_param" and "get_param" using a model which shall be referenced by an absolute path? I am calling a simulink model out of a MATLAB script, but this model is located in a different directory (not in the working directory).
This model can be executed by using the "sim" command in combination with the absolute path, e.g:
sim("C:UsersMATLABmyModel.slx")
Now I want to change the parameter of a "Contant" block when calling the simulation.
The functions "set_param" seems only to work with a model handle which was created by a model being in the current working path.
% name of model
mdl = "myMdl";

% name of the block
blk = "myConstBlk";

% Serch path
path = strcat(mdl, "/", blk);

% set parameter of Const
set_param(path, "Value", "5");
When performing the same action, but with an absolute path, this is not working anymore.
% name of model
mdl = "C:UsersMATLABmyModel.slx";

% name of the block
blk = "myConstBlk";

% Serch path
path = strcat(mdl, "/", blk);

% set parameter of Const
set_param(path, "Value", "5");
Invalid Simulink object name: ‘C:UsersMATLABmyMdl.slx/myConstBlk’.
Even if the model is loaded by:
h = load_system(mdl); %mdl is the absolute path
the handel "h" could not be used in the set_param function.
So therefore the qustion:
How to perform all the task provided by "set_param" and "get_param" using a model which shall be referenced by an absolute path? absolute path, simulink, set block parameter MATLAB Answers — New Questions

​

Can I use knobs to control several elements from the same injected struct?
Matlab News

Can I use knobs to control several elements from the same injected struct?

PuTI / 2025-01-31

I am accessing an injected struct that has several elements I want to use individual knobs to control through a mask but I am not seeing the elements when I try to connect the knobs to the constant block. Can anyone assist me?I am accessing an injected struct that has several elements I want to use individual knobs to control through a mask but I am not seeing the elements when I try to connect the knobs to the constant block. Can anyone assist me? I am accessing an injected struct that has several elements I want to use individual knobs to control through a mask but I am not seeing the elements when I try to connect the knobs to the constant block. Can anyone assist me? knob, struct, injected, mask MATLAB Answers — New Questions

​

Monte Carlo integration (hit or miss) to find the area of a circle of radius R
Matlab News

Monte Carlo integration (hit or miss) to find the area of a circle of radius R

PuTI / 2025-01-31

Hi everyone. Trying to solve an old exam topic regarding Monte Carlo integration, I wrote the following code for which I based it on a code from a professor in the C language. For R = 1 it worked so I assume I did it correctly. Then I tried R > 1 and the results were wrong compared to the formula πR^2 so I tried a few modifications by trial and error method. I fixed the problem and it seems to works correctly but there is a modification that I don’t understand. If you could help me understand this it would be great. Thank you in advance.
clear, clc, format short

%———- Computation for R = 1 ———-
R = 1;
N = 100000;
insideCircle = 0;

for i = 1:N

x = rand(1);
y = rand(1);

if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end

Area_MC = 4*insideCircle/N;
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;

fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);

%———- Computation for R > 1 (e.g. R = 4 but you can try any real value) ———-
R = 4;
N = 100000;
insideCircle = 0;

for i = 1:N

x = rand(1)*R;
y = rand(1)*R;

if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end

Area_MC = 4*R^3*insideCircle/N; % Modification needed that I don’t understand (I had to multiply with R^3)
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;

fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);Hi everyone. Trying to solve an old exam topic regarding Monte Carlo integration, I wrote the following code for which I based it on a code from a professor in the C language. For R = 1 it worked so I assume I did it correctly. Then I tried R > 1 and the results were wrong compared to the formula πR^2 so I tried a few modifications by trial and error method. I fixed the problem and it seems to works correctly but there is a modification that I don’t understand. If you could help me understand this it would be great. Thank you in advance.
clear, clc, format short

%———- Computation for R = 1 ———-
R = 1;
N = 100000;
insideCircle = 0;

for i = 1:N

x = rand(1);
y = rand(1);

if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end

Area_MC = 4*insideCircle/N;
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;

fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);

%———- Computation for R > 1 (e.g. R = 4 but you can try any real value) ———-
R = 4;
N = 100000;
insideCircle = 0;

for i = 1:N

x = rand(1)*R;
y = rand(1)*R;

if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end

Area_MC = 4*R^3*insideCircle/N; % Modification needed that I don’t understand (I had to multiply with R^3)
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;

fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error); Hi everyone. Trying to solve an old exam topic regarding Monte Carlo integration, I wrote the following code for which I based it on a code from a professor in the C language. For R = 1 it worked so I assume I did it correctly. Then I tried R > 1 and the results were wrong compared to the formula πR^2 so I tried a few modifications by trial and error method. I fixed the problem and it seems to works correctly but there is a modification that I don’t understand. If you could help me understand this it would be great. Thank you in advance.
clear, clc, format short

%———- Computation for R = 1 ———-
R = 1;
N = 100000;
insideCircle = 0;

for i = 1:N

x = rand(1);
y = rand(1);

if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end

Area_MC = 4*insideCircle/N;
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;

fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error);

%———- Computation for R > 1 (e.g. R = 4 but you can try any real value) ———-
R = 4;
N = 100000;
insideCircle = 0;

for i = 1:N

x = rand(1)*R;
y = rand(1)*R;

if (x^2 + y^2) < R
insideCircle = insideCircle + 1;
end
end

Area_MC = 4*R^3*insideCircle/N; % Modification needed that I don’t understand (I had to multiply with R^3)
Area = pi*R^2;
error = 100*abs(Area – Area_MC)/Area;

fprintf(‘ntExact areatt%fntMonte Carlo areat%fntPercentage errort%.2f%%n’,Area,Area_MC,error); monte carlo integration, hit or miss, area of a cirlcle MATLAB Answers — New Questions

​

Understanding basics of struct?
Matlab News

Understanding basics of struct?

PuTI / 2025-01-31

Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?

Big Thanks!!!Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?

Big Thanks!!! Hello,
A beginners short story with 3 and a half Questions:
I want to get a list of all filepath of filenames in a folder (?).
For that I’m using dir which creates a struct (so far so good).
Now I want to save the first colum with the filenames as a cell array (?)
Solved this by using struct2cell .
But is there a way to export a single colum (or even a defined range of that colum) ?
I was also thinking an easy for loop would solve that but…
I’m struggeling to get the length of the struct ?
And…
Is there an elegant way to sort names in the struct in a "natural way" (1,2,3,…,11,12 instead of 1,11,12,2,3,…) ?

Big Thanks!!! struct, filepath, struct2cell, struct length, struct sort, basics MATLAB Answers — New Questions

​

Mathlab Code for summation equation
Matlab News

Mathlab Code for summation equation

PuTI / 2025-01-31

Hi all,
How can I write matlab code for summation equation for the file attached.
Pls help.
Thank you guys..Hi all,
How can I write matlab code for summation equation for the file attached.
Pls help.
Thank you guys.. Hi all,
How can I write matlab code for summation equation for the file attached.
Pls help.
Thank you guys.. summation MATLAB Answers — New Questions

​

How do I write a .mat file (exported from the Design Data in an .sldd file) to a csv file?
Matlab News

How do I write a .mat file (exported from the Design Data in an .sldd file) to a csv file?

PuTI / 2025-01-31

I am trying to write the contents of a .mat file to a csv file. The .mat file was generated by exporting the Design Data from a simulink data dictionary file that is used in a Simulink model. I’ve tried to research how to extract the data from the .mat but haven’t been able to find anything significant. If you have any suggestions for strategies or functions I could use, please add a comment. Thanks.
CODE:
FileData = load(‘SLDD_220817.mat’);
NewData=struct2cell(FileData);
csvwrite(‘SLDD_220817.csv’, NewData);

CW OUTPUT:
Error using csvwrite (line 47)
The input cell array cannot be converted to a matrix.

Error in sldd_to_csv (line 11)
csvwrite(‘SLDD_220817.csv’, NewData);I am trying to write the contents of a .mat file to a csv file. The .mat file was generated by exporting the Design Data from a simulink data dictionary file that is used in a Simulink model. I’ve tried to research how to extract the data from the .mat but haven’t been able to find anything significant. If you have any suggestions for strategies or functions I could use, please add a comment. Thanks.
CODE:
FileData = load(‘SLDD_220817.mat’);
NewData=struct2cell(FileData);
csvwrite(‘SLDD_220817.csv’, NewData);

CW OUTPUT:
Error using csvwrite (line 47)
The input cell array cannot be converted to a matrix.

Error in sldd_to_csv (line 11)
csvwrite(‘SLDD_220817.csv’, NewData); I am trying to write the contents of a .mat file to a csv file. The .mat file was generated by exporting the Design Data from a simulink data dictionary file that is used in a Simulink model. I’ve tried to research how to extract the data from the .mat but haven’t been able to find anything significant. If you have any suggestions for strategies or functions I could use, please add a comment. Thanks.
CODE:
FileData = load(‘SLDD_220817.mat’);
NewData=struct2cell(FileData);
csvwrite(‘SLDD_220817.csv’, NewData);

CW OUTPUT:
Error using csvwrite (line 47)
The input cell array cannot be converted to a matrix.

Error in sldd_to_csv (line 11)
csvwrite(‘SLDD_220817.csv’, NewData); sldd, csvwrite MATLAB Answers — New Questions

​

how to changes for two parameters values in simulink block at same time  in matlab 2022. this function is already founded in matlab 2016
Matlab News

how to changes for two parameters values in simulink block at same time in matlab 2022. this function is already founded in matlab 2016

PuTI / 2025-01-31

Freq=0;F=0; n=0;A=0;
for k=1:20 Freq=Freq+50; n=n+1;
sim(‘Rc_model22’);
if k==1 t=Vcamp(:,1);Vcamp1(:,1)=Vcamp(:,2); AVc1(:,1)=AVc(:,2); end;
if k==2 Vcamp2(:,1)=Vcamp(:,2); AVc2(:,1)=AVc(:,2);end;
if k==3 Vcamp3(:,1)=Vcamp(:,2); AVc3(:,1)=AVc(:,2);end;
if k==4 Vcamp4(:,1)=Vcamp(:,2); AVc4(:,1)=AVc(:,2);end;
if k==5 Vcamp5(:,1)=Vcamp(:,2); AVc5(:,1)=AVc(:,2);end;
if k==6 Vcamp6(:,1)=Vcamp(:,2); AVc6(:,1)=AVc(:,2);end;
if k==7 Vcamp7(:,1)=Vcamp(:,2); AVc7(:,1)=AVc(:,2);end;
if k==8 Vcamp8(:,1)=Vcamp(:,2); AVc8(:,1)=AVc(:,2);end;
if k==9 Vcamp9(:,1)=Vcamp(:,2); AVc9(:,1)=AVc(:,2);end;
if k==10 Vcamp10(:,1)=Vcamp(:,2); AVc10(:,1)=AVc(:,2);end;
if k==11 Vcamp11(:,1)=Vcamp(:,2); AVc11(:,1)=AVc(:,2);end;
if k==12 Vcamp12(:,1)=Vcamp(:,2); AVc12(:,1)=AVc(:,2);end;
if k==13 Vcamp13(:,1)=Vcamp(:,2); AVc13(:,1)=AVc(:,2);end;
if k==14 Vcamp14(:,1)=Vcamp(:,2); AVc14(:,1)=AVc(:,2);end;
if k==15 Vcamp15(:,1)=Vcamp(:,2); AVc15(:,1)=AVc(:,2);end;
if k==16 Vcamp16(:,1)=Vcamp(:,2); AVc16(:,1)=AVc(:,2);end;
if k==17 Vcamp17(:,1)=Vcamp(:,2); AVc17(:,1)=AVc(:,2);end;
if k==18 Vcamp18(:,1)=Vcamp(:,2); AVc18(:,1)=AVc(:,2);end;
if k==19 Vcamp19(:,1)=Vcamp(:,2); AVc19(:,1)=AVc(:,2);end;
if k==20 Vcamp20(:,1)=Vcamp(:,2); AVc20(:,1)=AVc(:,2);end;
endFreq=0;F=0; n=0;A=0;
for k=1:20 Freq=Freq+50; n=n+1;
sim(‘Rc_model22’);
if k==1 t=Vcamp(:,1);Vcamp1(:,1)=Vcamp(:,2); AVc1(:,1)=AVc(:,2); end;
if k==2 Vcamp2(:,1)=Vcamp(:,2); AVc2(:,1)=AVc(:,2);end;
if k==3 Vcamp3(:,1)=Vcamp(:,2); AVc3(:,1)=AVc(:,2);end;
if k==4 Vcamp4(:,1)=Vcamp(:,2); AVc4(:,1)=AVc(:,2);end;
if k==5 Vcamp5(:,1)=Vcamp(:,2); AVc5(:,1)=AVc(:,2);end;
if k==6 Vcamp6(:,1)=Vcamp(:,2); AVc6(:,1)=AVc(:,2);end;
if k==7 Vcamp7(:,1)=Vcamp(:,2); AVc7(:,1)=AVc(:,2);end;
if k==8 Vcamp8(:,1)=Vcamp(:,2); AVc8(:,1)=AVc(:,2);end;
if k==9 Vcamp9(:,1)=Vcamp(:,2); AVc9(:,1)=AVc(:,2);end;
if k==10 Vcamp10(:,1)=Vcamp(:,2); AVc10(:,1)=AVc(:,2);end;
if k==11 Vcamp11(:,1)=Vcamp(:,2); AVc11(:,1)=AVc(:,2);end;
if k==12 Vcamp12(:,1)=Vcamp(:,2); AVc12(:,1)=AVc(:,2);end;
if k==13 Vcamp13(:,1)=Vcamp(:,2); AVc13(:,1)=AVc(:,2);end;
if k==14 Vcamp14(:,1)=Vcamp(:,2); AVc14(:,1)=AVc(:,2);end;
if k==15 Vcamp15(:,1)=Vcamp(:,2); AVc15(:,1)=AVc(:,2);end;
if k==16 Vcamp16(:,1)=Vcamp(:,2); AVc16(:,1)=AVc(:,2);end;
if k==17 Vcamp17(:,1)=Vcamp(:,2); AVc17(:,1)=AVc(:,2);end;
if k==18 Vcamp18(:,1)=Vcamp(:,2); AVc18(:,1)=AVc(:,2);end;
if k==19 Vcamp19(:,1)=Vcamp(:,2); AVc19(:,1)=AVc(:,2);end;
if k==20 Vcamp20(:,1)=Vcamp(:,2); AVc20(:,1)=AVc(:,2);end;
end Freq=0;F=0; n=0;A=0;
for k=1:20 Freq=Freq+50; n=n+1;
sim(‘Rc_model22’);
if k==1 t=Vcamp(:,1);Vcamp1(:,1)=Vcamp(:,2); AVc1(:,1)=AVc(:,2); end;
if k==2 Vcamp2(:,1)=Vcamp(:,2); AVc2(:,1)=AVc(:,2);end;
if k==3 Vcamp3(:,1)=Vcamp(:,2); AVc3(:,1)=AVc(:,2);end;
if k==4 Vcamp4(:,1)=Vcamp(:,2); AVc4(:,1)=AVc(:,2);end;
if k==5 Vcamp5(:,1)=Vcamp(:,2); AVc5(:,1)=AVc(:,2);end;
if k==6 Vcamp6(:,1)=Vcamp(:,2); AVc6(:,1)=AVc(:,2);end;
if k==7 Vcamp7(:,1)=Vcamp(:,2); AVc7(:,1)=AVc(:,2);end;
if k==8 Vcamp8(:,1)=Vcamp(:,2); AVc8(:,1)=AVc(:,2);end;
if k==9 Vcamp9(:,1)=Vcamp(:,2); AVc9(:,1)=AVc(:,2);end;
if k==10 Vcamp10(:,1)=Vcamp(:,2); AVc10(:,1)=AVc(:,2);end;
if k==11 Vcamp11(:,1)=Vcamp(:,2); AVc11(:,1)=AVc(:,2);end;
if k==12 Vcamp12(:,1)=Vcamp(:,2); AVc12(:,1)=AVc(:,2);end;
if k==13 Vcamp13(:,1)=Vcamp(:,2); AVc13(:,1)=AVc(:,2);end;
if k==14 Vcamp14(:,1)=Vcamp(:,2); AVc14(:,1)=AVc(:,2);end;
if k==15 Vcamp15(:,1)=Vcamp(:,2); AVc15(:,1)=AVc(:,2);end;
if k==16 Vcamp16(:,1)=Vcamp(:,2); AVc16(:,1)=AVc(:,2);end;
if k==17 Vcamp17(:,1)=Vcamp(:,2); AVc17(:,1)=AVc(:,2);end;
if k==18 Vcamp18(:,1)=Vcamp(:,2); AVc18(:,1)=AVc(:,2);end;
if k==19 Vcamp19(:,1)=Vcamp(:,2); AVc19(:,1)=AVc(:,2);end;
if k==20 Vcamp20(:,1)=Vcamp(:,2); AVc20(:,1)=AVc(:,2);end;
end how to changes for two parameters values in simuli MATLAB Answers — New Questions

​

How to sum the product between a matrix and 2 vectors
Matlab News

How to sum the product between a matrix and 2 vectors

PuTI / 2025-01-31

I need to solve a system of differential equation written as:

For each equation I should solve a summation like:

where K_Br is a matrix previously calculated and n is a vector as the solution of the differential equation system.
For example, for i=3:

I wrote the system of differential equation as:

function ndot = System_ni (t,n)
ndot = zeros(M,1);
ndot(1) = -n(1)*sum(K_Br(1,1:M)*n(1:M));
for i = 2:M
ndot(i) = 1/2*sum(K_Br(1:i-1,i-1:1)*n(i-1:1)*n(1:i-1))-n(i)*sum(K_Br(i,1:M)*n(1:M));
end
end
but summation seems not to work.
Thank you in advance for any help.I need to solve a system of differential equation written as:

For each equation I should solve a summation like:

where K_Br is a matrix previously calculated and n is a vector as the solution of the differential equation system.
For example, for i=3:

I wrote the system of differential equation as:

function ndot = System_ni (t,n)
ndot = zeros(M,1);
ndot(1) = -n(1)*sum(K_Br(1,1:M)*n(1:M));
for i = 2:M
ndot(i) = 1/2*sum(K_Br(1:i-1,i-1:1)*n(i-1:1)*n(1:i-1))-n(i)*sum(K_Br(i,1:M)*n(1:M));
end
end
but summation seems not to work.
Thank you in advance for any help. I need to solve a system of differential equation written as:

For each equation I should solve a summation like:

where K_Br is a matrix previously calculated and n is a vector as the solution of the differential equation system.
For example, for i=3:

I wrote the system of differential equation as:

function ndot = System_ni (t,n)
ndot = zeros(M,1);
ndot(1) = -n(1)*sum(K_Br(1,1:M)*n(1:M));
for i = 2:M
ndot(i) = 1/2*sum(K_Br(1:i-1,i-1:1)*n(i-1:1)*n(1:i-1))-n(i)*sum(K_Br(i,1:M)*n(1:M));
end
end
but summation seems not to work.
Thank you in advance for any help. summation, product, matrix vector product, differential equations MATLAB Answers — New Questions

​

The following code is correct?
Matlab News

The following code is correct?

PuTI / 2025-01-31

I have a Ph of size 139 48 101 values ranging say 0 to 0.4, now to compute Kd from Ph have two equations if Ph is equal or less than 0.35 and if Ph is greater than 0.35. I used following code to apply two equation. Have I done it correctly?
Kd = zeros(size(Ph));
% Find indices where Ph is less than or equal to 0.35
indices1 = Ph <= 0.35;
% Find indices where Ph is greater than 0.35
indices2 = Ph > 0.35;
% Apply the first equation to ‘kd’ where PhiE is less than or equal to 0.35
Kd(indices1) = 38.18.*(1-3.39.*Ph(indices1)+1.95.*Ph(indices1).^2).*1e9;
% Apply the second equation to ‘kd’ where Ph is greater than 0.35
Kd(indices2) = exp(-62.60.*PhiE(indices2)+22.58).*1e9;I have a Ph of size 139 48 101 values ranging say 0 to 0.4, now to compute Kd from Ph have two equations if Ph is equal or less than 0.35 and if Ph is greater than 0.35. I used following code to apply two equation. Have I done it correctly?
Kd = zeros(size(Ph));
% Find indices where Ph is less than or equal to 0.35
indices1 = Ph <= 0.35;
% Find indices where Ph is greater than 0.35
indices2 = Ph > 0.35;
% Apply the first equation to ‘kd’ where PhiE is less than or equal to 0.35
Kd(indices1) = 38.18.*(1-3.39.*Ph(indices1)+1.95.*Ph(indices1).^2).*1e9;
% Apply the second equation to ‘kd’ where Ph is greater than 0.35
Kd(indices2) = exp(-62.60.*PhiE(indices2)+22.58).*1e9; I have a Ph of size 139 48 101 values ranging say 0 to 0.4, now to compute Kd from Ph have two equations if Ph is equal or less than 0.35 and if Ph is greater than 0.35. I used following code to apply two equation. Have I done it correctly?
Kd = zeros(size(Ph));
% Find indices where Ph is less than or equal to 0.35
indices1 = Ph <= 0.35;
% Find indices where Ph is greater than 0.35
indices2 = Ph > 0.35;
% Apply the first equation to ‘kd’ where PhiE is less than or equal to 0.35
Kd(indices1) = 38.18.*(1-3.39.*Ph(indices1)+1.95.*Ph(indices1).^2).*1e9;
% Apply the second equation to ‘kd’ where Ph is greater than 0.35
Kd(indices2) = exp(-62.60.*PhiE(indices2)+22.58).*1e9; indexing, if statement, code MATLAB Answers — New Questions

​

C2000 Delfino does not receive code when being powered externally
Matlab News

C2000 Delfino does not receive code when being powered externally

PuTI / 2025-01-31

I am trying to make the LED on my F28379D blink as proof that I can flash code to the board. I have an old model in 2022a which has always compiled fine and works when being powered externally with all of the required hardware attached. I am migrating to 2024b and am trying to make the model run as such. When I power the delfino from the USB with nothing else attached it flashes fine and the LED blinks, when I take the exact same model and and run it on a board that is powered externally and has some other hardware attached (works for 2022a) simulink says that it copiles fine and uploads fine but doesn’t actually blink the led or run anything else.

Any help/ideas is greatly appreciated.I am trying to make the LED on my F28379D blink as proof that I can flash code to the board. I have an old model in 2022a which has always compiled fine and works when being powered externally with all of the required hardware attached. I am migrating to 2024b and am trying to make the model run as such. When I power the delfino from the USB with nothing else attached it flashes fine and the LED blinks, when I take the exact same model and and run it on a board that is powered externally and has some other hardware attached (works for 2022a) simulink says that it copiles fine and uploads fine but doesn’t actually blink the led or run anything else.

Any help/ideas is greatly appreciated. I am trying to make the LED on my F28379D blink as proof that I can flash code to the board. I have an old model in 2022a which has always compiled fine and works when being powered externally with all of the required hardware attached. I am migrating to 2024b and am trying to make the model run as such. When I power the delfino from the USB with nothing else attached it flashes fine and the LED blinks, when I take the exact same model and and run it on a board that is powered externally and has some other hardware attached (works for 2022a) simulink says that it copiles fine and uploads fine but doesn’t actually blink the led or run anything else.

Any help/ideas is greatly appreciated. simulink, c2000, microcontroller, delfino, f28379d MATLAB Answers — New Questions

​

Help with making an Ellipse Area function
Matlab News

Help with making an Ellipse Area function

PuTI / 2025-01-31

I am having trouble making my ellipse function work. I am using X,Y data in the function although there is an error in the script that is not allowing me to find the area. Also I would love help on displaying the ellipse.
This is the code for my function.
function[area] = Ellipse_Area(FCOPX,FCOPY)
sFCOPX=FCOPX*1000;
sFCOPY=FCOPY*1000;
Sx = std(sFCOPX);
Sy = std(sFCOPY);
Syx = 0;
for i = 1:length(sFCOPX)
Syx = Syx + (sFCOPX(i) – mean(sFCOPY))*(sFCOPX(i) – mean(sFCOPX));
endI am having trouble making my ellipse function work. I am using X,Y data in the function although there is an error in the script that is not allowing me to find the area. Also I would love help on displaying the ellipse.
This is the code for my function.
function[area] = Ellipse_Area(FCOPX,FCOPY)
sFCOPX=FCOPX*1000;
sFCOPY=FCOPY*1000;
Sx = std(sFCOPX);
Sy = std(sFCOPY);
Syx = 0;
for i = 1:length(sFCOPX)
Syx = Syx + (sFCOPX(i) – mean(sFCOPY))*(sFCOPX(i) – mean(sFCOPX));
end I am having trouble making my ellipse function work. I am using X,Y data in the function although there is an error in the script that is not allowing me to find the area. Also I would love help on displaying the ellipse.
This is the code for my function.
function[area] = Ellipse_Area(FCOPX,FCOPY)
sFCOPX=FCOPX*1000;
sFCOPY=FCOPY*1000;
Sx = std(sFCOPX);
Sy = std(sFCOPY);
Syx = 0;
for i = 1:length(sFCOPX)
Syx = Syx + (sFCOPX(i) – mean(sFCOPY))*(sFCOPX(i) – mean(sFCOPX));
end ellipse area, ellipse, area MATLAB Answers — New Questions

​

Viewing Live Script in viewer.mathworks.com
Matlab News

Viewing Live Script in viewer.mathworks.com

PuTI / 2025-01-31

Hi –
I am the steward for some open source projects, and we want to be able to include links to view the output of Matlab Live Scripts on the web.

There are several links like this on the File Exchange, for example one such link from https://www.mathworks.com/matlabcentral/fileexchange/134991-deepinterpolation-matlab is:
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2F84c22101-bffc-435a-910c-b0c7dcd5b386%2F4dd1b338-1032-45d1-b894-d1779b6d28f2%2Ffiles%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web

The trouble is that this links to a specific file in a specific version, and I’d like to be able to grab a Live Script from GitHub so that as the script is updated on GitHub, the viewing link always points to the latest version. Right now, I’d have to know the encoded path in FileExchange that will be generated when it updates the File Exchange version from GitHub.

But I don’t seem to be able to get the viewer to read from GitHub. It is possible that I have a path error here but I have redone this a couple times and I always see "We’re sorry, but something went wrong". So perhaps it’s not legal to pull scripts from other places?

https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fgithub.com%2FMATLAB-Community-Toolboxes-at-INCF%2FDeepInterpolation-MATLAB%2Fraw%2Fmain%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web

The broader issue is, is there any recommended way to keep a link to the "current" version instead of to a specific version?

Thanks
SteveHi –
I am the steward for some open source projects, and we want to be able to include links to view the output of Matlab Live Scripts on the web.

There are several links like this on the File Exchange, for example one such link from https://www.mathworks.com/matlabcentral/fileexchange/134991-deepinterpolation-matlab is:
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2F84c22101-bffc-435a-910c-b0c7dcd5b386%2F4dd1b338-1032-45d1-b894-d1779b6d28f2%2Ffiles%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web

The trouble is that this links to a specific file in a specific version, and I’d like to be able to grab a Live Script from GitHub so that as the script is updated on GitHub, the viewing link always points to the latest version. Right now, I’d have to know the encoded path in FileExchange that will be generated when it updates the File Exchange version from GitHub.

But I don’t seem to be able to get the viewer to read from GitHub. It is possible that I have a path error here but I have redone this a couple times and I always see "We’re sorry, but something went wrong". So perhaps it’s not legal to pull scripts from other places?

https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fgithub.com%2FMATLAB-Community-Toolboxes-at-INCF%2FDeepInterpolation-MATLAB%2Fraw%2Fmain%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web

The broader issue is, is there any recommended way to keep a link to the "current" version instead of to a specific version?

Thanks
Steve Hi –
I am the steward for some open source projects, and we want to be able to include links to view the output of Matlab Live Scripts on the web.

There are several links like this on the File Exchange, for example one such link from https://www.mathworks.com/matlabcentral/fileexchange/134991-deepinterpolation-matlab is:
https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fwww.mathworks.com%2Fmatlabcentral%2Fmlc-downloads%2Fdownloads%2F84c22101-bffc-435a-910c-b0c7dcd5b386%2F4dd1b338-1032-45d1-b894-d1779b6d28f2%2Ffiles%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web

The trouble is that this links to a specific file in a specific version, and I’d like to be able to grab a Live Script from GitHub so that as the script is updated on GitHub, the viewing link always points to the latest version. Right now, I’d have to know the encoded path in FileExchange that will be generated when it updates the File Exchange version from GitHub.

But I don’t seem to be able to get the viewer to read from GitHub. It is possible that I have a path error here but I have redone this a couple times and I always see "We’re sorry, but something went wrong". So perhaps it’s not legal to pull scripts from other places?

https://viewer.mathworks.com/?viewer=live_code&url=https%3A%2F%2Fgithub.com%2FMATLAB-Community-Toolboxes-at-INCF%2FDeepInterpolation-MATLAB%2Fraw%2Fmain%2Fexamples%2Ftiny_ephys_inference.mlx&embed=web

The broader issue is, is there any recommended way to keep a link to the "current" version instead of to a specific version?

Thanks
Steve viewer.mathworks.com, community toolbox documentation MATLAB Answers — New Questions

​

Phase error between two signals ?
Matlab News

Phase error between two signals ?

PuTI / 2025-01-31

Hello,
i have two inputs

V1=A1sin(wt)

and

V2=A2cos(wt+theta)

knowing that A1 is diffrent to A2 … i want to find Theta how can i do that in simulink ? thanks in advanceHello,
i have two inputs

V1=A1sin(wt)

and

V2=A2cos(wt+theta)

knowing that A1 is diffrent to A2 … i want to find Theta how can i do that in simulink ? thanks in advance Hello,
i have two inputs

V1=A1sin(wt)

and

V2=A2cos(wt+theta)

knowing that A1 is diffrent to A2 … i want to find Theta how can i do that in simulink ? thanks in advance phase error, two signals, simulink MATLAB Answers — New Questions

​

design repeated measurements model
Matlab News

design repeated measurements model

PuTI / 2025-01-31

Hi,
I’ve a table
t =

Group day1_1 day1_2 day2_1 day2_2
_________ ______ ______ ______ ______

‘Placebo’ 12.023 12.719 12.11 12.554
‘Placebo’ 11.806 12.186 12.788 12.164
‘Control’ 11.763 12.008 11.481 13.325
‘Placebo’ 11.703 11.678 12.073 12.234
‘Control’ 11.558 12.696 13.692 12.732
‘Placebo’ 13.633 13.253 11.347 12.432
‘Placebo’ 12.374 12.41 11.49 11.457
‘Placebo’ 11.476 11.564 12.542 11.112
‘Control’ 12.496 10.661 12.199 12.382
‘Placebo’ 12.659 12.863 11.844 11.799
‘Control’ 11.611 11.447 12.838 12.592
‘Placebo’ 12.524 13.7 11.772 11.387

where each row is a individual. individuals are tested on two following days with the same test (before and after). on the second day group Placebo is treated with a plecabo between measurement 1 and 2. We’re seeking for differences placebo vs control that only appear on day two.

here is the rest of my code:

Win = [1 2 1 3];
rm = fitrm(t,’day1_1-day2_2 ~ Group’,’WithinDesign’,Win);
tbl = ranova(rm);

is this correct? Probably not.

Edit:
still struggling with that. And we added ‘sex’ and ‘age’ to our data. Any comment/help welcome !

Thanks

DomHi,
I’ve a table
t =

Group day1_1 day1_2 day2_1 day2_2
_________ ______ ______ ______ ______

‘Placebo’ 12.023 12.719 12.11 12.554
‘Placebo’ 11.806 12.186 12.788 12.164
‘Control’ 11.763 12.008 11.481 13.325
‘Placebo’ 11.703 11.678 12.073 12.234
‘Control’ 11.558 12.696 13.692 12.732
‘Placebo’ 13.633 13.253 11.347 12.432
‘Placebo’ 12.374 12.41 11.49 11.457
‘Placebo’ 11.476 11.564 12.542 11.112
‘Control’ 12.496 10.661 12.199 12.382
‘Placebo’ 12.659 12.863 11.844 11.799
‘Control’ 11.611 11.447 12.838 12.592
‘Placebo’ 12.524 13.7 11.772 11.387

where each row is a individual. individuals are tested on two following days with the same test (before and after). on the second day group Placebo is treated with a plecabo between measurement 1 and 2. We’re seeking for differences placebo vs control that only appear on day two.

here is the rest of my code:

Win = [1 2 1 3];
rm = fitrm(t,’day1_1-day2_2 ~ Group’,’WithinDesign’,Win);
tbl = ranova(rm);

is this correct? Probably not.

Edit:
still struggling with that. And we added ‘sex’ and ‘age’ to our data. Any comment/help welcome !

Thanks

Dom Hi,
I’ve a table
t =

Group day1_1 day1_2 day2_1 day2_2
_________ ______ ______ ______ ______

‘Placebo’ 12.023 12.719 12.11 12.554
‘Placebo’ 11.806 12.186 12.788 12.164
‘Control’ 11.763 12.008 11.481 13.325
‘Placebo’ 11.703 11.678 12.073 12.234
‘Control’ 11.558 12.696 13.692 12.732
‘Placebo’ 13.633 13.253 11.347 12.432
‘Placebo’ 12.374 12.41 11.49 11.457
‘Placebo’ 11.476 11.564 12.542 11.112
‘Control’ 12.496 10.661 12.199 12.382
‘Placebo’ 12.659 12.863 11.844 11.799
‘Control’ 11.611 11.447 12.838 12.592
‘Placebo’ 12.524 13.7 11.772 11.387

where each row is a individual. individuals are tested on two following days with the same test (before and after). on the second day group Placebo is treated with a plecabo between measurement 1 and 2. We’re seeking for differences placebo vs control that only appear on day two.

here is the rest of my code:

Win = [1 2 1 3];
rm = fitrm(t,’day1_1-day2_2 ~ Group’,’WithinDesign’,Win);
tbl = ranova(rm);

is this correct? Probably not.

Edit:
still struggling with that. And we added ‘sex’ and ‘age’ to our data. Any comment/help welcome !

Thanks

Dom fitrm, repeated measurments, ranova, withindesign MATLAB Answers — New Questions

​

Reducing a dataset’s dimensions with PCA and projecting it onto a graph.
Matlab News

Reducing a dataset’s dimensions with PCA and projecting it onto a graph.

PuTI / 2025-01-31

Hi all,

Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?

[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);

From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct.Hi all,

Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?

[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);

From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct. Hi all,

Like the title says, I’d like to take a large dataset X of m by n size and reduce it’s dimensions to m by 2 length, and from there project it onto a 2D plane where the axis are the two main principal components of X. Is the below code enough, or have I missed a step?

[a,b] = pca(X);
b = b’;
plot(b(1,:),b(2,:),’.’);

From what I understand, taking the two columns of b gives me the two principal components that tell us the most about X’s structure, whilst having reduced it’s dimensions down. I’m basing this on the <http://www.nlpca.org/pca-principal-component-analysis-matlab.html code I found here,> but I just wanted to check I had it correct. pca, matlab, dimension reduction, datasets, data handling MATLAB Answers — New Questions

​

Previous 1 … 34 35 36 37 38 … 101 Next

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss