Category: News
How can I extract an array of numbers from a text-formatted cell array of strings.
I have read some data from a spreadsheet. The values are times, but formatted with s, m or h as a suffix to indicate seconds, minutes or hours. see example below,
I’d like to convert all of them to seconds, with NaN for the blank ones.
Is there an elegant way to do this?
Like this:
{’20s’ }
{’15m’ }
{0×0 char }
{’24s’ }
{0×0 char }
{’44s’ }
{‘3h’ }
{’40m’ }
{’20s’ }
{0×0 char }
{’14s’ }I have read some data from a spreadsheet. The values are times, but formatted with s, m or h as a suffix to indicate seconds, minutes or hours. see example below,
I’d like to convert all of them to seconds, with NaN for the blank ones.
Is there an elegant way to do this?
Like this:
{’20s’ }
{’15m’ }
{0×0 char }
{’24s’ }
{0×0 char }
{’44s’ }
{‘3h’ }
{’40m’ }
{’20s’ }
{0×0 char }
{’14s’ } I have read some data from a spreadsheet. The values are times, but formatted with s, m or h as a suffix to indicate seconds, minutes or hours. see example below,
I’d like to convert all of them to seconds, with NaN for the blank ones.
Is there an elegant way to do this?
Like this:
{’20s’ }
{’15m’ }
{0×0 char }
{’24s’ }
{0×0 char }
{’44s’ }
{‘3h’ }
{’40m’ }
{’20s’ }
{0×0 char }
{’14s’ } cell array, format MATLAB Answers — New Questions
insecure Private Channels!
I have noticed that Private channels field values can be read without read API keys using below request:
https://api.thingspeak.com/channels/{channel_Id}/fields/field1/last.html
it will make that channel insecure.
Am i missing something?I have noticed that Private channels field values can be read without read API keys using below request:
https://api.thingspeak.com/channels/{channel_Id}/fields/field1/last.html
it will make that channel insecure.
Am i missing something? I have noticed that Private channels field values can be read without read API keys using below request:
https://api.thingspeak.com/channels/{channel_Id}/fields/field1/last.html
it will make that channel insecure.
Am i missing something? thingspeak MATLAB Answers — New Questions
Find coordinate inside circular area of 2D plots.
Hi, now I am tryting to find coordinate inside circular area of my data.
I tried to use imfindcircles in my image process toolbox. However, it did not detect my circles.
Anyone have better suggestions to get coordinate inside of holes?
clear all;
fileID=fopen(’50_topo.txt’,’r’);
formatSpec = ‘%f’;
A=fscanf(fileID,formatSpec);
sq=zeros(256, 256);
sq=A;
sq=reshape(sq,256,[]);
%colormap(copper);
image(sq,’CDataMapping’,’scaled’);
colorbar;
caxis([-2 2]*10^-9);
fclose(fileID);Hi, now I am tryting to find coordinate inside circular area of my data.
I tried to use imfindcircles in my image process toolbox. However, it did not detect my circles.
Anyone have better suggestions to get coordinate inside of holes?
clear all;
fileID=fopen(’50_topo.txt’,’r’);
formatSpec = ‘%f’;
A=fscanf(fileID,formatSpec);
sq=zeros(256, 256);
sq=A;
sq=reshape(sq,256,[]);
%colormap(copper);
image(sq,’CDataMapping’,’scaled’);
colorbar;
caxis([-2 2]*10^-9);
fclose(fileID); Hi, now I am tryting to find coordinate inside circular area of my data.
I tried to use imfindcircles in my image process toolbox. However, it did not detect my circles.
Anyone have better suggestions to get coordinate inside of holes?
clear all;
fileID=fopen(’50_topo.txt’,’r’);
formatSpec = ‘%f’;
A=fscanf(fileID,formatSpec);
sq=zeros(256, 256);
sq=A;
sq=reshape(sq,256,[]);
%colormap(copper);
image(sq,’CDataMapping’,’scaled’);
colorbar;
caxis([-2 2]*10^-9);
fclose(fileID); image processing MATLAB Answers — New Questions
How to use N-channel igbt block from simulink with I-V characteristics defined from ‘3d lookup table’ option to give similar output characteristics from datasheets?
Hello all,In my application,I am trying to develop IGBT using gate driver circuit.
When Im selecting I-V characteristics defined by: 3D lookup table (temperature dependant), Im always getting Ic as 0 in the output. But in the syntax in the "help" documentation is given as zeroes(Vge,Vce,T). I also tried giving different combinations of Ic according to Vge,Vce and T. For example assuming Ic as 2x2x2 matrix .
First combination: [[[0,0],[60,100]],[[90,200],[250,400]]]
Second combination: [[0,0,60,100],[90,200,250,400]]
But nothing works,it doesn’t consider as 3D matrix. Then how exactly i should give the values especially Ic so that i do not get just 0s or errors. I have attached the model and datasheet output characteristics.Hello all,In my application,I am trying to develop IGBT using gate driver circuit.
When Im selecting I-V characteristics defined by: 3D lookup table (temperature dependant), Im always getting Ic as 0 in the output. But in the syntax in the "help" documentation is given as zeroes(Vge,Vce,T). I also tried giving different combinations of Ic according to Vge,Vce and T. For example assuming Ic as 2x2x2 matrix .
First combination: [[[0,0],[60,100]],[[90,200],[250,400]]]
Second combination: [[0,0,60,100],[90,200,250,400]]
But nothing works,it doesn’t consider as 3D matrix. Then how exactly i should give the values especially Ic so that i do not get just 0s or errors. I have attached the model and datasheet output characteristics. Hello all,In my application,I am trying to develop IGBT using gate driver circuit.
When Im selecting I-V characteristics defined by: 3D lookup table (temperature dependant), Im always getting Ic as 0 in the output. But in the syntax in the "help" documentation is given as zeroes(Vge,Vce,T). I also tried giving different combinations of Ic according to Vge,Vce and T. For example assuming Ic as 2x2x2 matrix .
First combination: [[[0,0],[60,100]],[[90,200],[250,400]]]
Second combination: [[0,0,60,100],[90,200,250,400]]
But nothing works,it doesn’t consider as 3D matrix. Then how exactly i should give the values especially Ic so that i do not get just 0s or errors. I have attached the model and datasheet output characteristics. simulink, simscape, electrical, power_electronics_control, igbt, power_electronics, n-channel_igbt MATLAB Answers — New Questions
Windows 11 Enterprise fails to adjust the sound volume when the Bluetooth audio player is used
When I use the Bluetooth headset and when I click on the audio icon in the tray and try to change the volume – the volume doesn’t change. The sound only gets muted when the volume dial is moved to the very left position, otherwise the volume remains constant.
The only way I can change volume is with YouTube volume dial. If some app wouldn’t allow changing volume – Bluetooth audio would be unusable.
This is a company-issued Dell laptop, which periodically says that it applies updates and reboots. I assume that the system is up-to-date.
Is this a known problem?
How to fix this problem?
When I use the Bluetooth headset and when I click on the audio icon in the tray and try to change the volume – the volume doesn’t change. The sound only gets muted when the volume dial is moved to the very left position, otherwise the volume remains constant. The only way I can change volume is with YouTube volume dial. If some app wouldn’t allow changing volume – Bluetooth audio would be unusable. This is a company-issued Dell laptop, which periodically says that it applies updates and reboots. I assume that the system is up-to-date.Is this a known problem?How to fix this problem? Read More
Stable Edge
Edge stable just updated, High cpu mem and power usage.
Would not connect to any website from favs or search. I tried an APP repair, and that seems to have worked. Not quite sure what the problem was, but will keep an eye on it.
Edge stable just updated, High cpu mem and power usage.Would not connect to any website from favs or search. I tried an APP repair, and that seems to have worked. Not quite sure what the problem was, but will keep an eye on it. Read More
MS Forms – shortcut on home screen on iPhone not working
Hi there,
I am trying to save a link to a MS form on the home screen of an iPhone. However, when I click on it it takes me to the general forms website instead of opening my specific form. Opening the link in safari works fine, it is just the home screen shortcut that seems to present a problem.
Any advice on this?
Thanks!
Hi there, I am trying to save a link to a MS form on the home screen of an iPhone. However, when I click on it it takes me to the general forms website instead of opening my specific form. Opening the link in safari works fine, it is just the home screen shortcut that seems to present a problem. Any advice on this?Thanks! Read More
What To Do When Stuck in Multi User Mode in QuickBooks Desktop
Getting stuck in multi-user mode while using QuickBooks Desktop can be a frustrating experience for users, especially when it disrupts workflow and productivity. In this article, we’ll explore what multi-user mode is, why getting stuck in it can occur, and provide detailed solutions to help you resolve this issue effectively.
Understanding QuickBooks Multi-User Mode Not Working Error:
QuickBooks Desktop offers a multi-user mode that allows multiple users to access the same company file simultaneously. This feature is particularly beneficial for businesses with multiple team members who need to work on the same accounting data concurrently. However, issues can arise when users find themselves unable to exit multi-user mode or switch back to single-user mode.
Reasons for Getting Stuck in Multi-User Mode in QuickBooks Desktop:
Software Glitches or Technical Issues: Like any software application, QuickBooks Desktop may encounter glitches or technical issues that prevent users from switching modes successfully. These issues can range from minor software bugs to more complex system conflicts that affect functionality.
Network Connectivity Problems: QuickBooks Desktop relies on network connectivity to facilitate multi-user mode. If there are network disruptions or connectivity issues between the user’s computer and the server hosting the company file, it can result in difficulties switching between modes or getting stuck in multi-user mode.
User Error or Misconfiguration: Sometimes, the issue may be attributed to user error or misconfiguration of QuickBooks settings. Users may inadvertently trigger actions that affect the software’s behavior, such as attempting to switch modes while certain tasks are still in progress or encountering conflicts with user permissions.
Solutions to Resolve Multi User Mode Not Working in QuickBooks Desktop
:
1. Verify Network Connectivity:
Start by verifying that your computer has a stable connection to the network where the QuickBooks company file is hosted. Check for any network disruptions or connectivity issues that may be preventing proper communication between your computer and the server. Restarting your router or reconnecting to the network may help resolve connectivity issues.
2. Close and Reopen QuickBooks:
If you’re unable to switch out of multi-user mode, try closing QuickBooks Desktop and reopening it. Sometimes, restarting the application can help reset any temporary glitches or issues that may be causing the problem. Ensure that all users log out of QuickBooks before attempting to switch modes again.
3. Use the QuickBooks Database Server Manager:
If you’re using QuickBooks in a multi-user environment, ensure that the QuickBooks Database Server Manager is installed and configured correctly on the server hosting the company file. This tool helps manage multi-user access and ensures that users can switch between modes seamlessly. Run the Database Server Manager and check for any errors or issues that may need to be resolved.
4. Check User Permissions:
Ensure that you have the necessary permissions to switch between modes in QuickBooks Desktop. Users with restricted permissions may encounter difficulties when attempting to switch from multi-user mode to single-user mode. Verify your user permissions with the QuickBooks administrator and adjust them if necessary to resolve the issue.
5. Update QuickBooks:
Ensure that you’re using the latest version of QuickBooks Desktop, as updates often include bug fixes and performance improvements that can address issues related to multi-user mode. Check for updates within the application or download the latest version from the QuickBooks website and install it on your computer.
6. Contact QuickBooks Support:
If you’ve tried the above solutions and are still unable to resolve the issue, consider reaching out to QuickBooks support for assistance. Provide detailed information about the problem you’re experiencing, including any error messages or codes you’ve encountered. The support team can offer personalized guidance and troubleshooting steps to help you resolve the issue.
Conclusion:
Getting stuck in multi-user mode in QuickBooks Desktop can disrupt your workflow and productivity, but understanding the potential reasons behind the issue and implementing appropriate solutions can help you overcome it effectively. By verifying network connectivity, closing and reopening QuickBooks, using the QuickBooks Database Server Manager, checking user permissions, updating QuickBooks, and contacting support when needed, you can troubleshoot and resolve multi-user mode issues, ensuring smooth operation of your accounting software. Proactive measures and attention to detail can help minimize disruptions and optimize efficiency in managing your company’s financial data.
Getting stuck in multi-user mode while using QuickBooks Desktop can be a frustrating experience for users, especially when it disrupts workflow and productivity. In this article, we’ll explore what multi-user mode is, why getting stuck in it can occur, and provide detailed solutions to help you resolve this issue effectively.Understanding QuickBooks Multi-User Mode Not Working Error: QuickBooks Desktop offers a multi-user mode that allows multiple users to access the same company file simultaneously. This feature is particularly beneficial for businesses with multiple team members who need to work on the same accounting data concurrently. However, issues can arise when users find themselves unable to exit multi-user mode or switch back to single-user mode.Reasons for Getting Stuck in Multi-User Mode in QuickBooks Desktop: Software Glitches or Technical Issues: Like any software application, QuickBooks Desktop may encounter glitches or technical issues that prevent users from switching modes successfully. These issues can range from minor software bugs to more complex system conflicts that affect functionality.Network Connectivity Problems: QuickBooks Desktop relies on network connectivity to facilitate multi-user mode. If there are network disruptions or connectivity issues between the user’s computer and the server hosting the company file, it can result in difficulties switching between modes or getting stuck in multi-user mode.User Error or Misconfiguration: Sometimes, the issue may be attributed to user error or misconfiguration of QuickBooks settings. Users may inadvertently trigger actions that affect the software’s behavior, such as attempting to switch modes while certain tasks are still in progress or encountering conflicts with user permissions.Solutions to Resolve Multi User Mode Not Working in QuickBooks Desktop:1. Verify Network Connectivity:Start by verifying that your computer has a stable connection to the network where the QuickBooks company file is hosted. Check for any network disruptions or connectivity issues that may be preventing proper communication between your computer and the server. Restarting your router or reconnecting to the network may help resolve connectivity issues.2. Close and Reopen QuickBooks:If you’re unable to switch out of multi-user mode, try closing QuickBooks Desktop and reopening it. Sometimes, restarting the application can help reset any temporary glitches or issues that may be causing the problem. Ensure that all users log out of QuickBooks before attempting to switch modes again.3. Use the QuickBooks Database Server Manager:If you’re using QuickBooks in a multi-user environment, ensure that the QuickBooks Database Server Manager is installed and configured correctly on the server hosting the company file. This tool helps manage multi-user access and ensures that users can switch between modes seamlessly. Run the Database Server Manager and check for any errors or issues that may need to be resolved.4. Check User Permissions:Ensure that you have the necessary permissions to switch between modes in QuickBooks Desktop. Users with restricted permissions may encounter difficulties when attempting to switch from multi-user mode to single-user mode. Verify your user permissions with the QuickBooks administrator and adjust them if necessary to resolve the issue.5. Update QuickBooks:Ensure that you’re using the latest version of QuickBooks Desktop, as updates often include bug fixes and performance improvements that can address issues related to multi-user mode. Check for updates within the application or download the latest version from the QuickBooks website and install it on your computer.6. Contact QuickBooks Support:If you’ve tried the above solutions and are still unable to resolve the issue, consider reaching out to QuickBooks support for assistance. Provide detailed information about the problem you’re experiencing, including any error messages or codes you’ve encountered. The support team can offer personalized guidance and troubleshooting steps to help you resolve the issue.Conclusion:Getting stuck in multi-user mode in QuickBooks Desktop can disrupt your workflow and productivity, but understanding the potential reasons behind the issue and implementing appropriate solutions can help you overcome it effectively. By verifying network connectivity, closing and reopening QuickBooks, using the QuickBooks Database Server Manager, checking user permissions, updating QuickBooks, and contacting support when needed, you can troubleshoot and resolve multi-user mode issues, ensuring smooth operation of your accounting software. Proactive measures and attention to detail can help minimize disruptions and optimize efficiency in managing your company’s financial data. Read More
Why Won’t QuickBooks Start Multi-User Mode?
Encountering difficulties when trying to start multi-user mode in QuickBooks can be a frustrating experience, especially for businesses relying on collaborative access to their accounting data. In this article, we’ll delve into what multi-user mode entails, explore potential reasons why QuickBooks may fail to start in multi-user mode, and provide comprehensive solutions to help you resolve this issue efficiently.
Understanding Multi-User Mode in QuickBooks:
QuickBooks Desktop offers a multi-user mode that enables multiple users to access the same company file simultaneously. This feature is invaluable for businesses with teams needing concurrent access to financial data for tasks like invoicing, payroll, and reporting. However, encountering issues when attempting to initiate multi-user mode can disrupt workflow and impede productivity.
Reasons Why QuickBooks Won’t Start in Multi-User Mode:
Network Connectivity Problems: QuickBooks relies on stable network connectivity to facilitate multi-user access. If there are network disruptions or connectivity issues between the host computer (where the QuickBooks company file is stored) and the client computers, it can prevent QuickBooks from starting in multi-user mode.
Corrupted Company File: A corrupted QuickBooks company file can cause various issues, including preventing multi-user mode from starting. If the company file is damaged or contains errors, QuickBooks may fail to initiate multi-user mode as a precautionary measure to prevent further data corruption.
Software Conflicts or Compatibility Issues: QuickBooks may encounter conflicts with other software applications installed on the host or client computers. Additionally, compatibility issues between QuickBooks and the operating system or third-party software can hinder the initiation of multi-user mode.
User Permissions or Configuration: In some cases, user permissions or misconfigurations within QuickBooks settings can prevent multi-user mode from starting. Users may not have sufficient permissions to access the company file in multi-user mode, or certain settings may be incorrectly configured, leading to startup failures.
Solutions to Resolve QuickBooks Multi-User Mode Not Working Error:
1. Verify Network Connectivity:
Start by checking the network connectivity between the host computer (where the QuickBooks company file is located) and the client computers. Ensure that all computers are connected to the same network and that there are no network disruptions or firewall restrictions blocking communication between devices.
2. Repair or Restore the Company File:
If QuickBooks is unable to start multi-user mode due to a corrupted company file, attempt to repair or restore the file using QuickBooks built-in utilities. QuickBooks offers tools like the File Doctor and the Rebuild Data feature, which can help diagnose and repair issues within the company file.
3. Check for Software Conflicts:
Identify any potential software conflicts or compatibility issues that may be preventing QuickBooks from starting in multi-user mode. Temporarily disable antivirus software, firewall settings, or third-party applications that may interfere with QuickBooks operation. Additionally, ensure that QuickBooks and all related software are up-to-date with the latest patches and updates.
4. Review User Permissions and Settings:
Verify that user permissions are configured correctly within QuickBooks and that users have the necessary rights to access the company file in multi-user mode. Check QuickBooks user roles and permissions settings to ensure that all users are appropriately authorized to use multi-user mode.
5. Restart QuickBooks Database Server Manager:
If QuickBooks Database Server Manager is installed on the host computer, restart the service to refresh connections and resolve potential issues. Navigate to the Windows Services Manager, locate the QuickBooks Database Server Manager service, and restart it. This action can often resolve connectivity issues and enable multi-user mode to start successfully.
Contact QuickBooks Support:
If you’ve tried the above solutions and are still unable to start multi-user mode in QuickBooks, consider reaching out to QuickBooks support for assistance. Provide detailed information about the issue you’re experiencing, including any error messages or codes encountered. The support team can offer personalized guidance and troubleshooting steps to help you resolve the issue.
Encountering difficulties when trying to start multi-user mode in QuickBooks can be a frustrating experience, especially for businesses relying on collaborative access to their accounting data. In this article, we’ll delve into what multi-user mode entails, explore potential reasons why QuickBooks may fail to start in multi-user mode, and provide comprehensive solutions to help you resolve this issue efficiently. Understanding Multi-User Mode in QuickBooks: QuickBooks Desktop offers a multi-user mode that enables multiple users to access the same company file simultaneously. This feature is invaluable for businesses with teams needing concurrent access to financial data for tasks like invoicing, payroll, and reporting. However, encountering issues when attempting to initiate multi-user mode can disrupt workflow and impede productivity. Reasons Why QuickBooks Won’t Start in Multi-User Mode: Network Connectivity Problems: QuickBooks relies on stable network connectivity to facilitate multi-user access. If there are network disruptions or connectivity issues between the host computer (where the QuickBooks company file is stored) and the client computers, it can prevent QuickBooks from starting in multi-user mode.Corrupted Company File: A corrupted QuickBooks company file can cause various issues, including preventing multi-user mode from starting. If the company file is damaged or contains errors, QuickBooks may fail to initiate multi-user mode as a precautionary measure to prevent further data corruption.Software Conflicts or Compatibility Issues: QuickBooks may encounter conflicts with other software applications installed on the host or client computers. Additionally, compatibility issues between QuickBooks and the operating system or third-party software can hinder the initiation of multi-user mode.User Permissions or Configuration: In some cases, user permissions or misconfigurations within QuickBooks settings can prevent multi-user mode from starting. Users may not have sufficient permissions to access the company file in multi-user mode, or certain settings may be incorrectly configured, leading to startup failures. Solutions to Resolve QuickBooks Multi-User Mode Not Working Error: 1. Verify Network Connectivity:Start by checking the network connectivity between the host computer (where the QuickBooks company file is located) and the client computers. Ensure that all computers are connected to the same network and that there are no network disruptions or firewall restrictions blocking communication between devices.2. Repair or Restore the Company File:If QuickBooks is unable to start multi-user mode due to a corrupted company file, attempt to repair or restore the file using QuickBooks built-in utilities. QuickBooks offers tools like the File Doctor and the Rebuild Data feature, which can help diagnose and repair issues within the company file.3. Check for Software Conflicts:Identify any potential software conflicts or compatibility issues that may be preventing QuickBooks from starting in multi-user mode. Temporarily disable antivirus software, firewall settings, or third-party applications that may interfere with QuickBooks operation. Additionally, ensure that QuickBooks and all related software are up-to-date with the latest patches and updates.4. Review User Permissions and Settings:Verify that user permissions are configured correctly within QuickBooks and that users have the necessary rights to access the company file in multi-user mode. Check QuickBooks user roles and permissions settings to ensure that all users are appropriately authorized to use multi-user mode.5. Restart QuickBooks Database Server Manager:If QuickBooks Database Server Manager is installed on the host computer, restart the service to refresh connections and resolve potential issues. Navigate to the Windows Services Manager, locate the QuickBooks Database Server Manager service, and restart it. This action can often resolve connectivity issues and enable multi-user mode to start successfully. Contact QuickBooks Support: If you’ve tried the above solutions and are still unable to start multi-user mode in QuickBooks, consider reaching out to QuickBooks support for assistance. Provide detailed information about the issue you’re experiencing, including any error messages or codes encountered. The support team can offer personalized guidance and troubleshooting steps to help you resolve the issue. Read More
Licensing Guest users for Planner Premium
Is it possible for a user who is a guest in a tenant to be licensed for planner premium? If so, is that done on their home tenant, or on the tenant they are a guest in?
Is it possible for a user who is a guest in a tenant to be licensed for planner premium? If so, is that done on their home tenant, or on the tenant they are a guest in? Read More
Security review for Microsoft Edge version 124
We are pleased to announce the security review for Microsoft Edge, version 124!
We have reviewed the new settings in Microsoft Edge version 124 and determined that there are no additional security settings that require enforcement. The Microsoft Edge version 117 security baseline continues to be our recommended configuration which can be downloaded from the Microsoft Security Compliance Toolkit.
Microsoft Edge version 124 introduced 14 new computer settings and 14 new user settings. We have included a spreadsheet listing the new settings in the release to make it easier for you to find them.
One thing to note with this release we have added configurable settings for Copilot. Something to consider based on your oprganizations policy
As a friendly reminder, all available settings for Microsoft Edge are documented here, and all available settings for Microsoft Edge Update are documented here.
Please continue to give us feedback through the Security Baselines Discussion site or this post.
Microsoft Tech Community – Latest Blogs –Read More
A Solution for ML Pipeline in Multi-tenancy Manner
Very often, Solution Providers have enterprise scenarios for deploying ML pipelines, where involves multiple tenants and each tenant may have their own Azure subscription.
There are some situations when designing the enterprise solution, for example:
Each tenant may want to keep their own data non-shared.
Each tenant has their own computing and hosting environment for ML training, retraining, and inferencing.
Each tenant may have different needs for retraining, with different scheduling, using different data sets.
Even for the same ML algorithm, each tenant may use different parameters.
The wants to maintain a centralized repository for all tenants’ data, models, environments, components, etc.
In addition, the wants flexibility to manage all tenants, when and how they want the tenants to share data, models, environments, pipeline environments. Each tenant has their flexibility to share those with other tenants as well.
We provide this multi-tenancy solution for Solution Providers to deploy and manage the ML pipelines across multiple workspaces, where each workspace may belong to a different Azure subscription.
The key element here is Azure Machine Learning (AzureML). It acts as a middleman for tenants to share data/models/environments/components, with version control. When creating an AzureML registry, it is essential to make it available for multiple regions where the tenants reside in. The tenants outside of the Primary and Additional regions covered by the registry are not able to share data/models/environments/components with the registry. Besides that, the registry needs to add the workspaces as user; in workspaces, need to assign certain role (i.e. contributor) to the ML registry owner at subscription level and workspace level.
The solution works in this way: Each tenant has their own workspace using their own subscription; within the workspace, the tenant is self-sufficient for computing and storage resources, it can build ML pipeline using its own data/models/environments/components. If the tenant wants to share data/models/environments/components with another tenant, it shares to the registry first, which we call ‘share’ in the picture below; then through the registry to share with other tenants, which we call ‘push’ in the picture below. Tenants can also get data/models/environments/components from registry, which we call ‘pull’ as shown in the picture below.
Share – from tenant (workspace) sends to registry.
Push – from registry sends to tenant (workspace).
Pull – tenant (workspace) gets from registry.
This kind of solution design can satisfy multiple scenarios of model sharing:
Each tenant can have their specific models without sharing with others.
All tenants can share their models if they want.
All tenants can pull the shared models and retrain or fine-tune, then share back the retrained or fine-tuned models.
Similar scenarios apply to data, environments, and components.
Notes:
If a tenant has multiple subscriptions, then the sharing is done at subscription level then workspace level.
This solution doesn’t apply if the sharing has to be done above subscription level. That means, if the ML registry can’t access the tenant’s subscription directly, then the ML registry can’t share/push entities to that tenant.
Below is an example for model sharing in four workspaces, where three of them belong to one subscription and the other one belongs to a different subscription.
In this example, workspace1 shares its model credit-card-default to registry, then the registry pushes to workspace3; workspace3 shares its model bert-case-uncased_fine-tuned to registry, then the registry pushes to workspace1, workspace2 and workspace4. The registry has both models.
For data, models, environments, components, the way of share/push/pull between tenant and registry are a little different. For ‘share/push’, it can be done in AzureML UI and SDK; for ‘pull’, it can be done in SDK.
Below is one example for ‘share’ model from workspace1 to registry using AzureML UI.
Below are some examples of SDK to get (‘pull’) data/model/environment/component from registry:
Then further register into the workspace, below is an example for environment:
The cool thing about this solution is that, once a tenant gets data/model/environment/component from registry, where originally shared by another tenant, it can build its own ML pipeline, run the pipeline using its own resources. Besides the way described above using SDK, the tenant can retrieve those from AzureML Designer. By filtering the registry creator, the workspace can see the data, model and component, and then create pipeline on the canvas.
Below is one example in workspace4, it gets model from registry where originally from workspace3, it uses its own data set, AzureML pre-built component, and creates a fine-tuning pipeline. After it runs the pipeline, fine-tunes the model, it can share a new version of fine-tuned model back to registry. Remember, workspace4 belongs to a different subscription from workspace3, it’s really cool!
The way registry ‘share/push’ model to a workspace is that it deploys a real-time or batch endpoint to the workspace. The workspace then can do inference using the endpoint. Below is an example, workspace4 gets the model from registry where originated from workspace3, then performs a test using input data.
If the workspace deployed an endpoint from the shared model, also ‘get/pull’ the model from the registry, it can add deployment to the endpoint, as shown below.
References:
Create and manage registries – Azure Machine Learning | Microsoft Learn
Share data across workspaces with registries (preview) – Azure Machine Learning | Microsoft Learn
Share models, components, and environments across workspaces with registries – Azure Machine Learning | Microsoft Learn
azure-docs/articles/machine-learning/how-to-share-models-pipelines-across-workspaces-with-registries.md at main · MicrosoftDocs/azure-docs (github.com)
Acknowledgement:
Thanks Daniel Scott-Raynsford and Facundo Santiago for encouraging me to write this article. We are glad to share this solution implementation broadly to help our customers.
Reviewers:
Daniel Scott-Raynsford, Takuto Higuchi, Alex Zeltov
Microsoft Tech Community – Latest Blogs –Read More
How to draw an inclined cone with an ellipse base in the three-dimensional XYZ coordinate system?
Hello!
How can I draw an inclined cone with an ellipse base in the three-dimensional XYZ coordinate system so that the values in the coordinate system are also shown (so that it would be possible to take one point on the ellipse and get the XYZ values)? It is also necessary that the edges of the inclined cone, constructed from the points of the minor and major axes, be visible. Something similar to the cone in the photo, but so that the ellipse is at a certain angle that can be changed.
I will be grateful for your help.Hello!
How can I draw an inclined cone with an ellipse base in the three-dimensional XYZ coordinate system so that the values in the coordinate system are also shown (so that it would be possible to take one point on the ellipse and get the XYZ values)? It is also necessary that the edges of the inclined cone, constructed from the points of the minor and major axes, be visible. Something similar to the cone in the photo, but so that the ellipse is at a certain angle that can be changed.
I will be grateful for your help. Hello!
How can I draw an inclined cone with an ellipse base in the three-dimensional XYZ coordinate system so that the values in the coordinate system are also shown (so that it would be possible to take one point on the ellipse and get the XYZ values)? It is also necessary that the edges of the inclined cone, constructed from the points of the minor and major axes, be visible. Something similar to the cone in the photo, but so that the ellipse is at a certain angle that can be changed.
I will be grateful for your help. cone, ellipse MATLAB Answers — New Questions
R2020b : coverage explorer cumulative data
With MATLAB R2020b
In simulink, how to filled the coverage explorer cumulative data field by script at ends of x simulations ?
thanksWith MATLAB R2020b
In simulink, how to filled the coverage explorer cumulative data field by script at ends of x simulations ?
thanks With MATLAB R2020b
In simulink, how to filled the coverage explorer cumulative data field by script at ends of x simulations ?
thanks coverage explorer MATLAB Answers — New Questions
view() not returning [az, el] ??
According to this documentation, I believe that the view function should be returning a two element vector [azimuth, elevation]. However, I observed that it actually returns a 4 x 4 projection matrix. But it won’t take one! So what do I need to do to get something out of view that it will accept later, to restore the viewpoint?
Here is a command window view of actions taken at a couple of breakpoints in my program:
(Breakpoint, when graph is showing a 3D plot)
K>> a=view(graph)
a =
0.7934 -0.6088 0 -0.0923
0.3044 0.3967 0.8660 -0.7835
0.5272 0.6871 -0.5000 8.3031
0 0 0 1.0000
(Another breakpoint, when graph is showing a 2D plot)
K>> a=view(graph)
a =
1.0000 0 0 -0.5000
0 1.0000 0 -0.5000
0 0 -1.0000 9.1603
0 0 0 1.0000
K>> view(graph, a)
Error using view>ViewCore
Argument must be scalar, or two-vector.
Error in view (line 93)
ViewCore(hAxes, viewArgs{:});According to this documentation, I believe that the view function should be returning a two element vector [azimuth, elevation]. However, I observed that it actually returns a 4 x 4 projection matrix. But it won’t take one! So what do I need to do to get something out of view that it will accept later, to restore the viewpoint?
Here is a command window view of actions taken at a couple of breakpoints in my program:
(Breakpoint, when graph is showing a 3D plot)
K>> a=view(graph)
a =
0.7934 -0.6088 0 -0.0923
0.3044 0.3967 0.8660 -0.7835
0.5272 0.6871 -0.5000 8.3031
0 0 0 1.0000
(Another breakpoint, when graph is showing a 2D plot)
K>> a=view(graph)
a =
1.0000 0 0 -0.5000
0 1.0000 0 -0.5000
0 0 -1.0000 9.1603
0 0 0 1.0000
K>> view(graph, a)
Error using view>ViewCore
Argument must be scalar, or two-vector.
Error in view (line 93)
ViewCore(hAxes, viewArgs{:}); According to this documentation, I believe that the view function should be returning a two element vector [azimuth, elevation]. However, I observed that it actually returns a 4 x 4 projection matrix. But it won’t take one! So what do I need to do to get something out of view that it will accept later, to restore the viewpoint?
Here is a command window view of actions taken at a couple of breakpoints in my program:
(Breakpoint, when graph is showing a 3D plot)
K>> a=view(graph)
a =
0.7934 -0.6088 0 -0.0923
0.3044 0.3967 0.8660 -0.7835
0.5272 0.6871 -0.5000 8.3031
0 0 0 1.0000
(Another breakpoint, when graph is showing a 2D plot)
K>> a=view(graph)
a =
1.0000 0 0 -0.5000
0 1.0000 0 -0.5000
0 0 -1.0000 9.1603
0 0 0 1.0000
K>> view(graph, a)
Error using view>ViewCore
Argument must be scalar, or two-vector.
Error in view (line 93)
ViewCore(hAxes, viewArgs{:}); uiaxes, view, 3d plots MATLAB Answers — New Questions
how to create text files from variable strings using function?
Hi guys, im facing difficulity when i export text from variable string array to files using fucntion. It happens error because fucntion cant call the variable which i defined. I want to make many files (total 75) and each file contains text like this :
here i give my script :
clear;
clc;
H = 5;
L = 15;
Ns = 2;
Nb = 1;
PortalHeight = H;
Bayspan = L;
NumberStory = Ns;
NumberBay = Nb;
% Variable1
h = [0.8,1.00,1.20,1.40,1.6,1.80];
% Variable2
Lss = [2.00,2.40,2.80,3.20,3.60,4.00];
% Variable3
Nss = [2,3,4];
% Definition
Var1HeightofTrussBeam = h;
Var2LengthSpecialSegment = Lss;
Var3NumberSpecialSegment = Nss;
% % Xbase = zeros(1,length(Totalvariant));
% % Zbase = zeros(1,length(Totalvariant));
% % Xcol = zeros(1,length(Totalvariant));
% % Zcol = zeros(1,length(Totalvariant));
% % Xos = zeros(1,length(Totalvariant));
% % Zos = zeros(1,length(Totalvariant));
% % Xss = zeros(1,length(Totalvariant));
% % Zss = zeros(1,length(Totalvariant));
% % X = zeros(1,length(Totalvariant));
% % Z = zeros(1,length(Totalvariant));
% % jointbase = zeros(1,length(Totalvariant));
% % jointcolumn = zeros(1,length(Totalvariant));
% % jointordinarysegment = zeros(1,length(Totalvariant));
% % jointtopordinarysegment = zeros(1,length(Totalvariant));
% % jointbottomordinarysegment = zeros(1,length(Totalvariant));
% % jointspecialsegment = zeros(1,length(Totalvariant));
% % jointtopspecialsegment = zeros(1,length(Totalvariant));
% % jointbottomspecialsegment = zeros(1,length(Totalvariant));
ijk = 0;
for i = 1:numel(h)
for j = 1:numel(Lss)
for k = 1:numel(Nss)
ijk = ijk+1;
Variantmodel{ijk,:} = table(ijk,h(i),Lss(j),Nss(k),’VariableNames’,{‘VariantID’,’Height’,’Length’,’Number’});
%% Cooridinate Point Base(base)
Xbase{ijk,:} = L*(0:NumberBay);
Zbase{ijk,:} = repelem(0,1,length(Xbase{ijk,:}));
%% Column(col)
Xcolumn = L*(0:NumberBay);
Zcolumn = repelem(H*(1:NumberStory),1,length(Xcolumn));
Xbotbeam = L*(0:NumberBay);
Zbotbeam = repelem((H*(1:NumberStory)-h(i)),1,length(Xbotbeam));
idx = unique(Zbotbeam(:).’);
Zbottombeam{ijk,:} = idx;
% replicate [X] to be the same size as [Z] for plotting:
Xcol{ijk,:} = repmat([Xcolumn,Xbotbeam],1,NumberStory);
Zcol{ijk,:} = [Zcolumn,Zbotbeam];
%% Cooridinate Point Ordinary Segment (os)
% calculate span length of ordinary segment
Los = (L-Lss(j))/2;
Nos = Los/h(i);
Nos = round(Nos);
los = Los/Nos;
totalspan{ijk,:} = los*Nos*2+Lss(j);
if totalspan{ijk,:} == 15.000
checkspan{ijk,:} = "correct span";
else
checkspan{ijk,:} = "span must be 15m";
end
% top and bottom joint of ordinary segment(os)
XTopOrdinarySegment = reshape([los*(1:Nos),(L/2+Lss(j)/2)+los*(0:Nos-1)].’+L*(0:(NumberBay-1)),1,[]);
XBottomOrdinarySegment = XTopOrdinarySegment;
ZTopOrdinarySegment = repelem(H*(1:NumberStory),1,2*Nos*NumberBay);
ZBottomOrdinarySegment = repelem(H*(1:NumberStory)-h(i),1,2*Nos*NumberBay);
% replicate [X] to be the same size as [Z] for plotting:
Xos{ijk,:} = repmat([XTopOrdinarySegment,XBottomOrdinarySegment],1,NumberStory);
Zos{ijk,:} = [ZTopOrdinarySegment,ZBottomOrdinarySegment];
%% Cooridinate Point Special Segment (ss)
% calculate span length of special segment
lss = Lss(j)/Nss(k);
% top and bottom joint of special segment(ss)
XTopSpecialSegment = reshape((lss*(0:Nss(k))+L/2-Lss(j)/2).’+L*(0:(NumberBay-1)),1,[]);
XBottomSpecialSegment = XTopSpecialSegment;
ZTopSpecialSegment = repelem(H*(1:NumberStory),1,length(XTopSpecialSegment));
ZBottomSpecialSegment = repelem(H*(1:NumberStory)-h(i),1,length(XBottomSpecialSegment));
% replicate [X] to be the same size as [Z] for plotting:
Xss{ijk,:} = repmat([XTopSpecialSegment,XBottomSpecialSegment],1,NumberStory);
Zss{ijk,:} = [ZTopSpecialSegment,ZBottomSpecialSegment];
%% Plot Cooridinate Point (X,Z)
X{ijk,:} = [Xbase{ijk,:},Xcol{ijk,:},Xos{ijk,:},Xss{ijk,:}];
Z{ijk,:} = [Zbase{ijk,:},Zcol{ijk,:},Zos{ijk,:},Zss{ijk,:}];
scatter(X{ijk,:},Z{ijk,:},’filled’),grid on
%check angle
tangent = (Lss(j)/Nss(k))/h(i);
anglespecialsegment(ijk) = atand(tangent);
%% Name the Joint
jointbase{ijk} = table((1:numel(Xbase{ijk,:}))’,Xbase{ijk,:}’,Zbase{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointcolumn{ijk} = table((max(jointbase{ijk}.ID)+1:numel(Xcol{ijk,:})+max(jointbase{ijk}.ID))’,Xcol{ijk,:}’,Zcol{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointordinarysegment{ijk} = table((max(jointcolumn{ijk}.ID)+1:numel(Xos{ijk,:})+max(jointcolumn{ijk}.ID))’,Xos{ijk,:}’,Zos{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zcolumn),:);
jointbottomordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zbotbeam),:);
jointspecialsegment{ijk} = table((max(jointbottomordinarysegment{ijk}.ID)+1:numel(Xss{ijk,:})+max(jointbottomordinarysegment{ijk}.ID))’,Xss{ijk,:}’,Zss{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zcolumn),:);
jointbottomspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zbotbeam),:);
end
end
end
% Verify Variants Which Passed the Angle Requirement
tablecheck = table((1:numel(anglespecialsegment))’,totalspan,anglespecialsegment’,’VariableNames’,{‘VariantID’,’Total Span’,’Angle’});
VariantIDPassed = tablecheck.VariantID(tablecheck.Angle>=30 & tablecheck.Angle<=60);
jointbase = table((1:numel(jointbase))’,jointbase’,’VariableNames’,{‘VariantID’,’Joint Base’});
jointbase = jointbase(ismember(jointbase.VariantID,VariantIDPassed),:);
jointcolumn = table((1:numel(jointcolumn))’,jointcolumn’,’VariableNames’,{‘VariantID’,’Joint Column’});
jointcolumn = jointcolumn(ismember(jointcolumn.VariantID,VariantIDPassed),:);
jointtopordinarysegment = table((1:numel(jointtopordinarysegment))’,jointtopordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Top Ordinary Segment’});
jointtopordinarysegment = jointtopordinarysegment(ismember(jointtopordinarysegment.VariantID,VariantIDPassed),:);
jointbottomordinarysegment = table((1:numel(jointbottomordinarysegment))’,jointbottomordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Ordinary Segment’});
jointbottomordinarysegment = jointbottomordinarysegment(ismember(jointbottomordinarysegment.VariantID,VariantIDPassed),:);
jointtopspecialsegment = table((1:numel(jointtopspecialsegment))’,jointtopspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Top Special Segment’});
jointtopspecialsegment = jointtopspecialsegment(ismember(jointtopspecialsegment.VariantID,VariantIDPassed),:);
jointbottomspecialsegment = table((1:numel(jointbottomspecialsegment))’,jointbottomspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Special Segment’});
jointbottomspecialsegment = jointbottomspecialsegment(ismember(jointbottomspecialsegment.VariantID,VariantIDPassed),:);
Zbottombeam{ijk} = table((1:numel(Zbottombeam{ijk,:}))’,Zbottombeam{ijk,:}’,’VariableNames’,{‘VariantID’,’Z Bottom Beam’});
Zbottombeam = Zbottombeam(VariantIDPassed);
%% Name the Frame
% column
for i = 1:height(VariantIDPassed)
jointIcolumn = 0;
jointJcolumn = 0;
jointcolumnnew{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointcolumnnew{i,:} = vertcat(jointbase.("Joint Base"){i},jointcolumnnew{i});
for j = 1:height(jointcolumnnew{i,1})-2
jointIcolumn(j) = jointcolumnnew{i,1}.ID(j);
jointJcolumn(j) = jointcolumnnew{i,1}.ID(j+2);
end
framecolumn{i,:} = table((1:j)’,jointIcolumn’,jointJcolumn’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Name the Frame
% top ordinary segment (TOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endTOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointTOS{i,:} = vertcat(jointtopordinarysegment.("Joint Top Ordinary Segment"){i},endTOS{i});
jointTOSnew1{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H),:),2);
jointTOSnew2{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H*Ns),:),2);
jointTOSnew{i,:} = vertcat(jointTOSnew1{i},jointTOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew1{i,1})-1
jointI(j) = jointTOSnew1{i,1}.ID(j);
jointJ(j) = jointTOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(framecolumn{i,1}.("Frame ID"));
frameTOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS1{i,1}(median(1:height(frameTOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew2{i,1})-1
jointI(j) = jointTOSnew2{i,1}.ID(j);
jointJ(j) = jointTOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS1{i,1}.("Frame ID"));
frameTOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS2{i,1}(median(1:height(frameTOS2{i,1})),:) = [];
end
frameTOS = cellfun(@(varargin)vertcat(varargin{:}),frameTOS1,frameTOS2,’UniformOutput’,false);
%% Name the Frame
% bottom ordinary segment (BOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endBOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i}.Z),:);
jointBOS{i,:} = vertcat(jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i},endBOS{i});
jointBOSnew1{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(1)),:),2);
jointBOSnew2{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(2)),:),2);
jointBOSnew{i,:} = vertcat(jointBOSnew1{i},jointBOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBOSnew1{i,1})-1
jointI(j) = jointBOSnew1{i,1}.ID(j);
jointJ(j) = jointBOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS{i,1}.("Frame ID"));
frameBOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS1{i,1}(median(1:height(frameBOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ =0;
for j = 1:height(jointBOSnew2{i,1})-1
jointI(j) = jointBOSnew2{i,1}.ID(j);
jointJ(j) = jointBOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS1{i,1}.("Frame ID"));
frameBOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS2{i,1}(median(1:height(frameBOS2{i,1})),:) = [];
end
frameBOS = cellfun(@(varargin)vertcat(varargin{:}),frameBOS1,frameBOS2,’UniformOutput’,false);
%% Name the Frame
% top special segment (TSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointTSSnew1{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H),:),2);
jointTSSnew2{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H*Ns),:),2);
jointTSSnew{i,:} = vertcat(jointTSSnew1{i},jointTSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew1{i,1})-1
jointI(j) = jointTSSnew1{i,1}.ID(j);
jointJ(j) = jointTSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS{i,1}.("Frame ID"));
frameTSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew2{i,1})-1
jointI(j) = jointTSSnew2{i,1}.ID(j);
jointJ(j) = jointTSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS1{i,1}.("Frame ID"));
frameTSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameTSS = cellfun(@(varargin)vertcat(varargin{:}),frameTSS1,frameTSS2,’UniformOutput’,false);
%% Name the Frame
% bottom special segment (BSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointBSSnew1{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(1)),:),2);
jointBSSnew2{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(2)),:),2);
jointBSSnew{i,:} = vertcat(jointBSSnew1{i},jointBSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew1{i,1})-1
jointI(j) = jointBSSnew1{i,1}.ID(j);
jointJ(j) = jointBSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS{i,1}.("Frame ID"));
frameBSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew2{i,1})-1
jointI(j) = jointBSSnew2{i,1}.ID(j);
jointJ(j) = jointBSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBSS1{i,1}.("Frame ID"));
frameBSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameBSS = cellfun(@(varargin)vertcat(varargin{:}),frameBSS1,frameBSS2,’UniformOutput’,false);
%% Name the Frame
% diagonal ordinary segment (DOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tosleft{i,:} = frameTOS{i,1}(1:2:end,:);
tosright{i,:} = frameTOS{i,1}(2:2:end,:);
bosleft{i,:} = frameBOS{i,1}(1:2:end,:);
bosright{i,:} = frameBOS{i,1}(2:2:end,:);
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tosleft{i,1})
jointI(j) = tosleft{i,1}.JointI(j);
jointJ(j) = bosleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameBSS{i,1}.("Frame ID"));
frameDOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bosright{i,1})
jointI(j) = bosright{i,1}.JointI(j);
jointJ(j) = tosright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS1{i,1}.("Frame ID"));
frameDOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDOS = cellfun(@(varargin)vertcat(varargin{:}),frameDOS1,frameDOS2,’UniformOutput’,false);
%% Name the Frame
% diagonal special segment (DSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
tssright{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
bssright{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS{i,1}.("Frame ID"));
frameDSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bssright{i,1})
jointI(j) = bssright{i,1}.JointI(j);
jointJ(j) = tssright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDSS1{i,1}.("Frame ID"));
frameDSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDSS = cellfun(@(varargin)vertcat(varargin{:}),frameDSS1,frameDSS2,’UniformOutput’,false);
%% Name the Frame
% vertical special segment (VSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointI(j);
end
lastframenumber{i,:} = max(frameDSS{i,1}.("Frame ID"));
frameVSS{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Print ‘frame’ data to textline
txtframeCOLUMN = strings(height(framecolumn),1);
for i = 1:height(framecolumn)
T = framecolumn{i};
M = T{:,:};
txtframeCOLUMN(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTOS = strings(height(frameTOS),1);
for i = 1:height(frameTOS)
T = frameTOS{i};
M = T{:,:};
txtframeTOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBOS = strings(height(frameBOS),1);
for i = 1:height(frameBOS)
T = frameBOS{i};
M = T{:,:};
txtframeBOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTSS = strings(height(frameTSS),1);
for i = 1:height(frameTSS)
T = frameTSS{i};
M = T{:,:};
txtframeTSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBSS = strings(height(frameBSS),1);
for i = 1:height(frameBSS)
T = frameBSS{i};
M = T{:,:};
txtframeBSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDOS = strings(height(frameDOS),1);
for i = 1:height(frameDOS)
T = frameDOS{i};
M = T{:,:};
txtframeDOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDSS = strings(height(frameDSS),1);
for i = 1:height(frameDSS)
T = frameDSS{i};
M = T{:,:};
txtframeDSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeVSS = strings(height(frameVSS),1);
for i = 1:height(frameVSS)
T = frameVSS{i};
M = T{:,:};
txtframeVSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
%% Print ‘joint’ data to textline
txtjointBASE = strings(height(jointbase),1);
for i = 1:height(jointbase)
T = jointbase.("Joint Base"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBASE(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointCOLUMN = strings(height(jointcolumn),1);
for i = 1:height(jointcolumn)
T = jointcolumn.("Joint Column"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointCOLUMN(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTOS = strings(height(jointtopordinarysegment),1);
for i = 1:height(jointtopordinarysegment)
T = jointtopordinarysegment.("Joint Top Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBOS = strings(height(jointbottomordinarysegment),1);
for i = 1:height(jointbottomordinarysegment)
T = jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTSS = strings(height(jointtopspecialsegment),1);
for i = 1:height(jointtopspecialsegment)
T = jointtopspecialsegment.("Joint Top Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBSS = strings(height(jointbottomspecialsegment),1);
for i = 1:height(jointbottomspecialsegment)
T = jointbottomspecialsegment.("Joint Bottom Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
%% WRITE s2k Extension Files
VariantModel = compose(‘%d’, 1:height(VariantIDPassed));
for i = 1:numel(VariantModel)
writefile(VariantModel{i});
end
files = dir(‘*.s2k’);
files(:).name;
function writefile(C)
fido = fopen("ModelVariant"+C+".s2k",’wt’);
newline = ‘n’;
line1=’File D:MAGISTERKULIAHTESISS2K FILEModelVariant-%d.s2k was saved on m/d/yy at h:mm:ss’;
line2=’TABLE: "PROGRAM CONTROL"’;
line3=’ ProgramName=SAP2000 Version=25.0.0 ProgLevel=Ultimate LicenseNum=3010*1D6KZBK478DMQCT LicenseOS=Yes LicenseSC=Yes LicenseHT=No CurrUnits="KN, m, C" SteelCode="AISC 360-10" ConcCode="ACI 318-19" AlumCode="AA 2015" _’;
line4=’ ColdCode=AISI-16 RegenHinge=Yes’;
line5=’TABLE: "ACTIVE DEGREES OF FREEDOM"’;
line6=’ UX=Yes UY=No UZ=Yes RX=No RY=Yes RZ=No’;
line7=’TABLE: "ANALYSIS OPTIONS"’;
line8=’ Solver=Multithreaded SolverProc="Analysis Process" NumParallel=0 Force32Bit=No StiffCase=None GeomMod=None HingeOpt="In Elements" NumAThreads=0 MaxFileSize=0 NumDThreads=0 NumRThreads=0 _ UseMMFiles="Program Determined" AllowDiff=No’;
line9=’TABLE: "COORDINATE SYSTEMS"’;
line10=’ Name=GLOBAL Type=Cartesian X=0 Y=0 Z=0 AboutZ=0 AboutY=0 AboutX=0′;
line11=’TABLE: "GRID LINES"’;
line12=’ CoordSys=GLOBAL AxisDir=X GridID=A XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End AllVisible=Yes BubbleSize=1,5′;
line13=’ CoordSys=GLOBAL AxisDir=X GridID=B XRYZCoord=15 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line14=’ CoordSys=GLOBAL AxisDir=X GridID=C XRYZCoord=30 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line15=’ CoordSys=GLOBAL AxisDir=Y GridID=1 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=Start’;
line16=’ CoordSys=GLOBAL AxisDir=Z GridID=Z0 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line17=’ CoordSys=GLOBAL AxisDir=Z GridID=Z1 XRYZCoord=5 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line18=’ CoordSys=GLOBAL AxisDir=Z GridID=Z2 XRYZCoord=10 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line19=’TABLE: "MATERIAL PROPERTIES 01 – GENERAL"’;
line20=’ Material=4000Psi Type=Concrete Grade="’ + "f’c 4000 " + ‘psi"’+ ‘ SymType=Isotropic TempDepend=No Color=Green GUID=b0920fc0-a39b-46e4-a096-037f0f0739a7 Notes="Customary ‘+"f’c 4000 psi "+’01/02/2024 20:13:33"’;
line21=’ Material=BJ-37 Type=Steel Grade="Grade 50" SymType=Isotropic TempDepend=No Color=Magenta Notes="ASTM A992 Grade 50 01/02/2024 20:03:34"’;
line22=’TABLE: "MATERIAL PROPERTIES 02 – BASIC MECHANICAL PROPERTIES"’;
line23=’ Material=4000Psi UnitWeight=23,5631216161854 UnitMass=2,40276960558926 E1=24855578,0600518 G12=10356490,8583549 U12=0,2 A1=9,89999952793124E-06′;
line24=’ Material=BJ-37 UnitWeight=76,9728639422648 UnitMass=7,84904737995992 E1=199947978,795958 G12=76903068,7676762 U12=0,3 A1=1,16999994421006E-05′;
line25=’TABLE: "MATERIAL PROPERTIES 03A – STEEL DATA"’;
line26=’ Material=BJ-37 Fy=235000 Fu=352500 EffFy=235000 EffFu=352500 SSCurveOpt=Simple SSHysType=Kinematic SHard=0,015 SMax=0,11 SRup=0,17 FinalSlope=-0,1 CoupModType="Von Mises"’;
line27=’TABLE: "MATERIAL PROPERTIES 06 – DAMPING PARAMETERS"’;
line28=’ Material=4000Psi ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line29=’ Material=BJ-37 ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line30=’TABLE: "MATERIAL PROPERTIES 09 – ACCEPTANCE CRITERIA"’;
line31=’ Material=4000Psi IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,003 LSComp=-0,006 CPComp=-0,015 IgnoreTens=Yes’;
line32=’ Material=BJ-37 IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,005 LSComp=-0,01 CPComp=-0,02′;
line33=’TABLE: "FRAME SECTION PROPERTIES 01 – GENERAL"’;
line34=’ SectionName=ExampleWideFlanged Material=BJ-37 Shape="I/Wide Flange" t3=0,25 t2=0,15 tf=0,012 tw=0,008 t2b=0,15 tfb=0,012 FilletRadius=0,012 Area=0,005552 TorsConst=2,13418666666667E-07 I33=6,04638656154112E-05 _’;
line35=’ I22=6,76749435145855E-06 I23=-6,7762635780344E-21 AS2=0,00200790111881035 AS3=0,00357344416053972 S33Top=0,00048371092492329 S33Bot=0,00048371092492329 S22Left=9,02332580194473E-05 S22Right=9,02332580194473E-05 _’;
line36=’ Z33=0,000546402338734841 Z22=0,00013961366126516 R33=0,10435739412628 R22=0,0349131651083826 CGOffset3=-1,38777878078145E-17 CGOffset2=5,55111512312578E-17 EccV2=0 EccV3=0 Cw=9,558675E-08 ConcCol=No ConcBeam=No _’;
line37=’ Color=Blue TotalWt=60,3707599671425 TotalMass=6,15610399662034 FromFile=No AMod=1 A2Mod=1 A3Mod=1 JMod=1 I2Mod=1 I3Mod=1 MMod=1 WMod=1 Notes="Added 03/04/2024 20:08:55′;
line38=’TABLE: "LOAD PATTERN DEFINITIONS"’;
line39=’ LoadPat=DEAD DesignType=Dead SelfWtMult=1 GUID=d2c74fc0-a771-416d-b3dc-4b0a2047268d’;
line40=’ LoadPat=SUPERDEAD DesignType="Super Dead" SelfWtMult=0 GUID=91534b51-672f-4fb0-a037-d7225de00c69 Notes="Added 01/02/2024 20:08:11"’;
line41=’ LoadPat=LIVE DesignType=Live SelfWtMult=0 GUID=1f6f6fd1-e0f1-4fcb-bf3d-dc86bd53f1a8 Notes="Added 01/02/2024 20:08:16"’;
line42=’TABLE: "GROUPS 1 – DEFINITIONS"’;
line43=’ GroupName=All Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line44=’ GroupName=ST_Top Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line45=’ GroupName=ST_Bot Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line46=’ GroupName=ST_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line47=’ GroupName=ST_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line48=’ GroupName=OT_Top1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line49=’ GroupName=OT_Top2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Yellow’;
line49a=’ GroupName=OT_Bot1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line49b=’ GroupName=OT_Bot2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line49c=’ GroupName=OT_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line49d=’ GroupName=OT_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line49e=’ GroupName=Column_End Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line50=’TABLE: "JOINT PATTERN DEFINITIONS"’;
line51=’ Pattern=Default’;
line52=’TABLE: "MASS SOURCE"’;
line53=’ MassSource=MSSSRC1 Elements=Yes Masses=Yes Loads=Yes IsDefault=Yes LoadPat=DEAD Multiplier=1′;
line54=’ MassSource=MSSSRC1 LoadPat=SUPERDEAD Multiplier=1′;
line55=’ MassSource=MSSSRC1 LoadPat=LIVE Multiplier=0,5′;
line56=’TABLE: "LOAD CASE DEFINITIONS"’;
line57=’ Case=DEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=91b91585-f6e6-446e-ac30-362013fd8af9′;
line58=’ Case=MODAL Type=LinModal InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Other DesActOpt="Prog Det" DesignAct=Other AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=3e160405-efbf-45fb-ae06-c6da634ca183′;
line59=’ Case=SUPERDEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType="Super Dead" DesActOpt="Prog Det" DesignAct="Long-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=2ca565b7-af73-42e9-9208-0a0739594699′;
line60=’ Case=LIVE Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Live DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e969dd8f-56cc-40d7-af8a-0fba39157fcb’;
line61=’ Case="Gravity NLS" Type=NonStatic InitialCond=Zero MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line62=’ Case=Pushover-UX Type=NonStatic InitialCond="Gravity NLS" MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Quake DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line63=’TABLE: "CASE – STATIC 1 – LOAD ASSIGNMENTS"’;
line64=’ Case=DEAD LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line65=’ Case=SUPERDEAD LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line66=’ Case=LIVE LoadType="Load pattern" LoadName=LIVE LoadSF=1′;
line67=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line68=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line69=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=LIVE LoadSF=0,5′;
line70=’ Case=Pushover-UX LoadType=Accel LoadName="Accel UX" TransAccSF=-1′;
line71=’TABLE: "CASE – STATIC 2 – NONLINEAR LOAD APPLICATION"’;
line72=’ Case="Gravity NLS" LoadApp="Full Load" MonitorDOF=U1 MonitorJt=9′;
line73=’ Case=Pushover-UX LoadApp="Displ Ctrl" DisplType=Monitored TargetDispl=1 MonitorDOF=U1 MonitorJt=9′;
line74=’TABLE: "CASE – STATIC 4 – NONLINEAR PARAMETERS"’;
line75=’ Case="Gravity NLS" GeoNonLin=P-Delta ResultsSave="Final State" SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 _’;
line76=’ TFAccelFact=1 TFNoStop=No’;
line77=’ Case=Pushover-UX GeoNonLin=P-Delta ResultsSave="Multiple States" MinNumState=10 MaxNumState=100 PosIncOnly=Yes SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 _’;
line78=’ MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 TFAccelFact=1 TFNoStop=No’;
line79=’TABLE: "CASE – MODAL 1 – GENERAL"’;
line80=’ Case=MODAL ModeType=Eigen MaxNumModes=12 MinNumModes=1 EigenShift=0 EigenCutoff=0 EigenTol=1E-09 AutoShift=Yes’;
line81=’TABLE: "JOINT COORDINATES"’;
line82= append(txtjointBASE(i),newline,txtjointCOLUMN(i),newline,txtjointTOS(i),newline,txtjointBOS(i),newline,txtjointTSS(i),newline,txtjointBSS(i));
line83=’TABLE: "CONNECTIVITY – FRAME"’;
line84= append(txtframeCOLUMN(i),newline,txtframeTOS(i),newline,txtframeBOS(i),newline,txtframeTSS(i),newline,txtframeBSS(i),newline,txtframeDOS(i),newline,txtframeDSS(i),newline,txtframeVSS(i));
line85=’TABLE: "END TABLE DATA"’;
combine1 = append(line1,newline,line2,newline,line3,newline,line4,newline,line5,newline,line6,newline,line7,newline,line8,newline,line9,newline,line10,newline,line11,newline,line12,newline,line13,newline,line14,newline,line15,newline,line16,newline,line17,newline,line18,newline,line19,newline,line20,newline,line21,newline,line22,newline,line23,newline,line24,newline,line25,newline,line26,newline,line27,newline,line28,newline,line29,newline,line30,newline,line31,newline,line32,newline,line33,newline,line34,newline,line35,newline,line36);
combine2 = append(combine1,newline,line37,newline,line38,newline,line39,newline,line40,newline,line41,newline,line42,newline,line43,newline,line44,newline,line45,newline,line46,newline,line47,newline,line48,newline,line49,newline,line49a,newline,line49b,newline,line49c,newline,line49d,newline,line49e,newline,line50,newline,line51,newline,line52,newline,line53,newline,line54,newline,line55,newline,line56,newline,line57,newline,line58,newline,line59,newline,line60,newline,line61,newline,line62,newline,line63,newline,line64,newline,line65,newline,line66,newline,line67,newline,line68,newline);
combine3 = append(combine2,line69,newline,line70,newline,line71,newline,line72,newline,line73,newline,line74,newline,line75,newline,line76,newline,line77,newline,line78,newline,line79,newline,line80,newline,line81,newline,line82,newline,line83,newline,line84,newline,line85);
fprintf(fido,combine3,C);
fclose(fido);
end
error : Unrecognized function or variable
‘txtjointBASE’.
Error in cobadoang5_1>writefile (line 579)
line82= append(txtjointBASE(i),newline,txtjointCOLUMN(i),newline,txtjointTOS(i),newline,txtjointBOS(i),newline,txtjointTSS(i),newline,txtjointBSS(i));
Error in cobadoang5_1 (line 484)
writefile(VariantModel{i});Hi guys, im facing difficulity when i export text from variable string array to files using fucntion. It happens error because fucntion cant call the variable which i defined. I want to make many files (total 75) and each file contains text like this :
here i give my script :
clear;
clc;
H = 5;
L = 15;
Ns = 2;
Nb = 1;
PortalHeight = H;
Bayspan = L;
NumberStory = Ns;
NumberBay = Nb;
% Variable1
h = [0.8,1.00,1.20,1.40,1.6,1.80];
% Variable2
Lss = [2.00,2.40,2.80,3.20,3.60,4.00];
% Variable3
Nss = [2,3,4];
% Definition
Var1HeightofTrussBeam = h;
Var2LengthSpecialSegment = Lss;
Var3NumberSpecialSegment = Nss;
% % Xbase = zeros(1,length(Totalvariant));
% % Zbase = zeros(1,length(Totalvariant));
% % Xcol = zeros(1,length(Totalvariant));
% % Zcol = zeros(1,length(Totalvariant));
% % Xos = zeros(1,length(Totalvariant));
% % Zos = zeros(1,length(Totalvariant));
% % Xss = zeros(1,length(Totalvariant));
% % Zss = zeros(1,length(Totalvariant));
% % X = zeros(1,length(Totalvariant));
% % Z = zeros(1,length(Totalvariant));
% % jointbase = zeros(1,length(Totalvariant));
% % jointcolumn = zeros(1,length(Totalvariant));
% % jointordinarysegment = zeros(1,length(Totalvariant));
% % jointtopordinarysegment = zeros(1,length(Totalvariant));
% % jointbottomordinarysegment = zeros(1,length(Totalvariant));
% % jointspecialsegment = zeros(1,length(Totalvariant));
% % jointtopspecialsegment = zeros(1,length(Totalvariant));
% % jointbottomspecialsegment = zeros(1,length(Totalvariant));
ijk = 0;
for i = 1:numel(h)
for j = 1:numel(Lss)
for k = 1:numel(Nss)
ijk = ijk+1;
Variantmodel{ijk,:} = table(ijk,h(i),Lss(j),Nss(k),’VariableNames’,{‘VariantID’,’Height’,’Length’,’Number’});
%% Cooridinate Point Base(base)
Xbase{ijk,:} = L*(0:NumberBay);
Zbase{ijk,:} = repelem(0,1,length(Xbase{ijk,:}));
%% Column(col)
Xcolumn = L*(0:NumberBay);
Zcolumn = repelem(H*(1:NumberStory),1,length(Xcolumn));
Xbotbeam = L*(0:NumberBay);
Zbotbeam = repelem((H*(1:NumberStory)-h(i)),1,length(Xbotbeam));
idx = unique(Zbotbeam(:).’);
Zbottombeam{ijk,:} = idx;
% replicate [X] to be the same size as [Z] for plotting:
Xcol{ijk,:} = repmat([Xcolumn,Xbotbeam],1,NumberStory);
Zcol{ijk,:} = [Zcolumn,Zbotbeam];
%% Cooridinate Point Ordinary Segment (os)
% calculate span length of ordinary segment
Los = (L-Lss(j))/2;
Nos = Los/h(i);
Nos = round(Nos);
los = Los/Nos;
totalspan{ijk,:} = los*Nos*2+Lss(j);
if totalspan{ijk,:} == 15.000
checkspan{ijk,:} = "correct span";
else
checkspan{ijk,:} = "span must be 15m";
end
% top and bottom joint of ordinary segment(os)
XTopOrdinarySegment = reshape([los*(1:Nos),(L/2+Lss(j)/2)+los*(0:Nos-1)].’+L*(0:(NumberBay-1)),1,[]);
XBottomOrdinarySegment = XTopOrdinarySegment;
ZTopOrdinarySegment = repelem(H*(1:NumberStory),1,2*Nos*NumberBay);
ZBottomOrdinarySegment = repelem(H*(1:NumberStory)-h(i),1,2*Nos*NumberBay);
% replicate [X] to be the same size as [Z] for plotting:
Xos{ijk,:} = repmat([XTopOrdinarySegment,XBottomOrdinarySegment],1,NumberStory);
Zos{ijk,:} = [ZTopOrdinarySegment,ZBottomOrdinarySegment];
%% Cooridinate Point Special Segment (ss)
% calculate span length of special segment
lss = Lss(j)/Nss(k);
% top and bottom joint of special segment(ss)
XTopSpecialSegment = reshape((lss*(0:Nss(k))+L/2-Lss(j)/2).’+L*(0:(NumberBay-1)),1,[]);
XBottomSpecialSegment = XTopSpecialSegment;
ZTopSpecialSegment = repelem(H*(1:NumberStory),1,length(XTopSpecialSegment));
ZBottomSpecialSegment = repelem(H*(1:NumberStory)-h(i),1,length(XBottomSpecialSegment));
% replicate [X] to be the same size as [Z] for plotting:
Xss{ijk,:} = repmat([XTopSpecialSegment,XBottomSpecialSegment],1,NumberStory);
Zss{ijk,:} = [ZTopSpecialSegment,ZBottomSpecialSegment];
%% Plot Cooridinate Point (X,Z)
X{ijk,:} = [Xbase{ijk,:},Xcol{ijk,:},Xos{ijk,:},Xss{ijk,:}];
Z{ijk,:} = [Zbase{ijk,:},Zcol{ijk,:},Zos{ijk,:},Zss{ijk,:}];
scatter(X{ijk,:},Z{ijk,:},’filled’),grid on
%check angle
tangent = (Lss(j)/Nss(k))/h(i);
anglespecialsegment(ijk) = atand(tangent);
%% Name the Joint
jointbase{ijk} = table((1:numel(Xbase{ijk,:}))’,Xbase{ijk,:}’,Zbase{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointcolumn{ijk} = table((max(jointbase{ijk}.ID)+1:numel(Xcol{ijk,:})+max(jointbase{ijk}.ID))’,Xcol{ijk,:}’,Zcol{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointordinarysegment{ijk} = table((max(jointcolumn{ijk}.ID)+1:numel(Xos{ijk,:})+max(jointcolumn{ijk}.ID))’,Xos{ijk,:}’,Zos{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zcolumn),:);
jointbottomordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zbotbeam),:);
jointspecialsegment{ijk} = table((max(jointbottomordinarysegment{ijk}.ID)+1:numel(Xss{ijk,:})+max(jointbottomordinarysegment{ijk}.ID))’,Xss{ijk,:}’,Zss{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zcolumn),:);
jointbottomspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zbotbeam),:);
end
end
end
% Verify Variants Which Passed the Angle Requirement
tablecheck = table((1:numel(anglespecialsegment))’,totalspan,anglespecialsegment’,’VariableNames’,{‘VariantID’,’Total Span’,’Angle’});
VariantIDPassed = tablecheck.VariantID(tablecheck.Angle>=30 & tablecheck.Angle<=60);
jointbase = table((1:numel(jointbase))’,jointbase’,’VariableNames’,{‘VariantID’,’Joint Base’});
jointbase = jointbase(ismember(jointbase.VariantID,VariantIDPassed),:);
jointcolumn = table((1:numel(jointcolumn))’,jointcolumn’,’VariableNames’,{‘VariantID’,’Joint Column’});
jointcolumn = jointcolumn(ismember(jointcolumn.VariantID,VariantIDPassed),:);
jointtopordinarysegment = table((1:numel(jointtopordinarysegment))’,jointtopordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Top Ordinary Segment’});
jointtopordinarysegment = jointtopordinarysegment(ismember(jointtopordinarysegment.VariantID,VariantIDPassed),:);
jointbottomordinarysegment = table((1:numel(jointbottomordinarysegment))’,jointbottomordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Ordinary Segment’});
jointbottomordinarysegment = jointbottomordinarysegment(ismember(jointbottomordinarysegment.VariantID,VariantIDPassed),:);
jointtopspecialsegment = table((1:numel(jointtopspecialsegment))’,jointtopspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Top Special Segment’});
jointtopspecialsegment = jointtopspecialsegment(ismember(jointtopspecialsegment.VariantID,VariantIDPassed),:);
jointbottomspecialsegment = table((1:numel(jointbottomspecialsegment))’,jointbottomspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Special Segment’});
jointbottomspecialsegment = jointbottomspecialsegment(ismember(jointbottomspecialsegment.VariantID,VariantIDPassed),:);
Zbottombeam{ijk} = table((1:numel(Zbottombeam{ijk,:}))’,Zbottombeam{ijk,:}’,’VariableNames’,{‘VariantID’,’Z Bottom Beam’});
Zbottombeam = Zbottombeam(VariantIDPassed);
%% Name the Frame
% column
for i = 1:height(VariantIDPassed)
jointIcolumn = 0;
jointJcolumn = 0;
jointcolumnnew{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointcolumnnew{i,:} = vertcat(jointbase.("Joint Base"){i},jointcolumnnew{i});
for j = 1:height(jointcolumnnew{i,1})-2
jointIcolumn(j) = jointcolumnnew{i,1}.ID(j);
jointJcolumn(j) = jointcolumnnew{i,1}.ID(j+2);
end
framecolumn{i,:} = table((1:j)’,jointIcolumn’,jointJcolumn’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Name the Frame
% top ordinary segment (TOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endTOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointTOS{i,:} = vertcat(jointtopordinarysegment.("Joint Top Ordinary Segment"){i},endTOS{i});
jointTOSnew1{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H),:),2);
jointTOSnew2{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H*Ns),:),2);
jointTOSnew{i,:} = vertcat(jointTOSnew1{i},jointTOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew1{i,1})-1
jointI(j) = jointTOSnew1{i,1}.ID(j);
jointJ(j) = jointTOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(framecolumn{i,1}.("Frame ID"));
frameTOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS1{i,1}(median(1:height(frameTOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew2{i,1})-1
jointI(j) = jointTOSnew2{i,1}.ID(j);
jointJ(j) = jointTOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS1{i,1}.("Frame ID"));
frameTOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS2{i,1}(median(1:height(frameTOS2{i,1})),:) = [];
end
frameTOS = cellfun(@(varargin)vertcat(varargin{:}),frameTOS1,frameTOS2,’UniformOutput’,false);
%% Name the Frame
% bottom ordinary segment (BOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endBOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i}.Z),:);
jointBOS{i,:} = vertcat(jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i},endBOS{i});
jointBOSnew1{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(1)),:),2);
jointBOSnew2{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(2)),:),2);
jointBOSnew{i,:} = vertcat(jointBOSnew1{i},jointBOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBOSnew1{i,1})-1
jointI(j) = jointBOSnew1{i,1}.ID(j);
jointJ(j) = jointBOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS{i,1}.("Frame ID"));
frameBOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS1{i,1}(median(1:height(frameBOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ =0;
for j = 1:height(jointBOSnew2{i,1})-1
jointI(j) = jointBOSnew2{i,1}.ID(j);
jointJ(j) = jointBOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS1{i,1}.("Frame ID"));
frameBOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS2{i,1}(median(1:height(frameBOS2{i,1})),:) = [];
end
frameBOS = cellfun(@(varargin)vertcat(varargin{:}),frameBOS1,frameBOS2,’UniformOutput’,false);
%% Name the Frame
% top special segment (TSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointTSSnew1{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H),:),2);
jointTSSnew2{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H*Ns),:),2);
jointTSSnew{i,:} = vertcat(jointTSSnew1{i},jointTSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew1{i,1})-1
jointI(j) = jointTSSnew1{i,1}.ID(j);
jointJ(j) = jointTSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS{i,1}.("Frame ID"));
frameTSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew2{i,1})-1
jointI(j) = jointTSSnew2{i,1}.ID(j);
jointJ(j) = jointTSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS1{i,1}.("Frame ID"));
frameTSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameTSS = cellfun(@(varargin)vertcat(varargin{:}),frameTSS1,frameTSS2,’UniformOutput’,false);
%% Name the Frame
% bottom special segment (BSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointBSSnew1{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(1)),:),2);
jointBSSnew2{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(2)),:),2);
jointBSSnew{i,:} = vertcat(jointBSSnew1{i},jointBSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew1{i,1})-1
jointI(j) = jointBSSnew1{i,1}.ID(j);
jointJ(j) = jointBSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS{i,1}.("Frame ID"));
frameBSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew2{i,1})-1
jointI(j) = jointBSSnew2{i,1}.ID(j);
jointJ(j) = jointBSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBSS1{i,1}.("Frame ID"));
frameBSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameBSS = cellfun(@(varargin)vertcat(varargin{:}),frameBSS1,frameBSS2,’UniformOutput’,false);
%% Name the Frame
% diagonal ordinary segment (DOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tosleft{i,:} = frameTOS{i,1}(1:2:end,:);
tosright{i,:} = frameTOS{i,1}(2:2:end,:);
bosleft{i,:} = frameBOS{i,1}(1:2:end,:);
bosright{i,:} = frameBOS{i,1}(2:2:end,:);
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tosleft{i,1})
jointI(j) = tosleft{i,1}.JointI(j);
jointJ(j) = bosleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameBSS{i,1}.("Frame ID"));
frameDOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bosright{i,1})
jointI(j) = bosright{i,1}.JointI(j);
jointJ(j) = tosright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS1{i,1}.("Frame ID"));
frameDOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDOS = cellfun(@(varargin)vertcat(varargin{:}),frameDOS1,frameDOS2,’UniformOutput’,false);
%% Name the Frame
% diagonal special segment (DSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
tssright{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
bssright{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS{i,1}.("Frame ID"));
frameDSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bssright{i,1})
jointI(j) = bssright{i,1}.JointI(j);
jointJ(j) = tssright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDSS1{i,1}.("Frame ID"));
frameDSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDSS = cellfun(@(varargin)vertcat(varargin{:}),frameDSS1,frameDSS2,’UniformOutput’,false);
%% Name the Frame
% vertical special segment (VSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointI(j);
end
lastframenumber{i,:} = max(frameDSS{i,1}.("Frame ID"));
frameVSS{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Print ‘frame’ data to textline
txtframeCOLUMN = strings(height(framecolumn),1);
for i = 1:height(framecolumn)
T = framecolumn{i};
M = T{:,:};
txtframeCOLUMN(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTOS = strings(height(frameTOS),1);
for i = 1:height(frameTOS)
T = frameTOS{i};
M = T{:,:};
txtframeTOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBOS = strings(height(frameBOS),1);
for i = 1:height(frameBOS)
T = frameBOS{i};
M = T{:,:};
txtframeBOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTSS = strings(height(frameTSS),1);
for i = 1:height(frameTSS)
T = frameTSS{i};
M = T{:,:};
txtframeTSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBSS = strings(height(frameBSS),1);
for i = 1:height(frameBSS)
T = frameBSS{i};
M = T{:,:};
txtframeBSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDOS = strings(height(frameDOS),1);
for i = 1:height(frameDOS)
T = frameDOS{i};
M = T{:,:};
txtframeDOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDSS = strings(height(frameDSS),1);
for i = 1:height(frameDSS)
T = frameDSS{i};
M = T{:,:};
txtframeDSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeVSS = strings(height(frameVSS),1);
for i = 1:height(frameVSS)
T = frameVSS{i};
M = T{:,:};
txtframeVSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
%% Print ‘joint’ data to textline
txtjointBASE = strings(height(jointbase),1);
for i = 1:height(jointbase)
T = jointbase.("Joint Base"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBASE(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointCOLUMN = strings(height(jointcolumn),1);
for i = 1:height(jointcolumn)
T = jointcolumn.("Joint Column"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointCOLUMN(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTOS = strings(height(jointtopordinarysegment),1);
for i = 1:height(jointtopordinarysegment)
T = jointtopordinarysegment.("Joint Top Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBOS = strings(height(jointbottomordinarysegment),1);
for i = 1:height(jointbottomordinarysegment)
T = jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTSS = strings(height(jointtopspecialsegment),1);
for i = 1:height(jointtopspecialsegment)
T = jointtopspecialsegment.("Joint Top Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBSS = strings(height(jointbottomspecialsegment),1);
for i = 1:height(jointbottomspecialsegment)
T = jointbottomspecialsegment.("Joint Bottom Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
%% WRITE s2k Extension Files
VariantModel = compose(‘%d’, 1:height(VariantIDPassed));
for i = 1:numel(VariantModel)
writefile(VariantModel{i});
end
files = dir(‘*.s2k’);
files(:).name;
function writefile(C)
fido = fopen("ModelVariant"+C+".s2k",’wt’);
newline = ‘n’;
line1=’File D:MAGISTERKULIAHTESISS2K FILEModelVariant-%d.s2k was saved on m/d/yy at h:mm:ss’;
line2=’TABLE: "PROGRAM CONTROL"’;
line3=’ ProgramName=SAP2000 Version=25.0.0 ProgLevel=Ultimate LicenseNum=3010*1D6KZBK478DMQCT LicenseOS=Yes LicenseSC=Yes LicenseHT=No CurrUnits="KN, m, C" SteelCode="AISC 360-10" ConcCode="ACI 318-19" AlumCode="AA 2015" _’;
line4=’ ColdCode=AISI-16 RegenHinge=Yes’;
line5=’TABLE: "ACTIVE DEGREES OF FREEDOM"’;
line6=’ UX=Yes UY=No UZ=Yes RX=No RY=Yes RZ=No’;
line7=’TABLE: "ANALYSIS OPTIONS"’;
line8=’ Solver=Multithreaded SolverProc="Analysis Process" NumParallel=0 Force32Bit=No StiffCase=None GeomMod=None HingeOpt="In Elements" NumAThreads=0 MaxFileSize=0 NumDThreads=0 NumRThreads=0 _ UseMMFiles="Program Determined" AllowDiff=No’;
line9=’TABLE: "COORDINATE SYSTEMS"’;
line10=’ Name=GLOBAL Type=Cartesian X=0 Y=0 Z=0 AboutZ=0 AboutY=0 AboutX=0′;
line11=’TABLE: "GRID LINES"’;
line12=’ CoordSys=GLOBAL AxisDir=X GridID=A XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End AllVisible=Yes BubbleSize=1,5′;
line13=’ CoordSys=GLOBAL AxisDir=X GridID=B XRYZCoord=15 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line14=’ CoordSys=GLOBAL AxisDir=X GridID=C XRYZCoord=30 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line15=’ CoordSys=GLOBAL AxisDir=Y GridID=1 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=Start’;
line16=’ CoordSys=GLOBAL AxisDir=Z GridID=Z0 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line17=’ CoordSys=GLOBAL AxisDir=Z GridID=Z1 XRYZCoord=5 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line18=’ CoordSys=GLOBAL AxisDir=Z GridID=Z2 XRYZCoord=10 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line19=’TABLE: "MATERIAL PROPERTIES 01 – GENERAL"’;
line20=’ Material=4000Psi Type=Concrete Grade="’ + "f’c 4000 " + ‘psi"’+ ‘ SymType=Isotropic TempDepend=No Color=Green GUID=b0920fc0-a39b-46e4-a096-037f0f0739a7 Notes="Customary ‘+"f’c 4000 psi "+’01/02/2024 20:13:33"’;
line21=’ Material=BJ-37 Type=Steel Grade="Grade 50" SymType=Isotropic TempDepend=No Color=Magenta Notes="ASTM A992 Grade 50 01/02/2024 20:03:34"’;
line22=’TABLE: "MATERIAL PROPERTIES 02 – BASIC MECHANICAL PROPERTIES"’;
line23=’ Material=4000Psi UnitWeight=23,5631216161854 UnitMass=2,40276960558926 E1=24855578,0600518 G12=10356490,8583549 U12=0,2 A1=9,89999952793124E-06′;
line24=’ Material=BJ-37 UnitWeight=76,9728639422648 UnitMass=7,84904737995992 E1=199947978,795958 G12=76903068,7676762 U12=0,3 A1=1,16999994421006E-05′;
line25=’TABLE: "MATERIAL PROPERTIES 03A – STEEL DATA"’;
line26=’ Material=BJ-37 Fy=235000 Fu=352500 EffFy=235000 EffFu=352500 SSCurveOpt=Simple SSHysType=Kinematic SHard=0,015 SMax=0,11 SRup=0,17 FinalSlope=-0,1 CoupModType="Von Mises"’;
line27=’TABLE: "MATERIAL PROPERTIES 06 – DAMPING PARAMETERS"’;
line28=’ Material=4000Psi ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line29=’ Material=BJ-37 ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line30=’TABLE: "MATERIAL PROPERTIES 09 – ACCEPTANCE CRITERIA"’;
line31=’ Material=4000Psi IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,003 LSComp=-0,006 CPComp=-0,015 IgnoreTens=Yes’;
line32=’ Material=BJ-37 IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,005 LSComp=-0,01 CPComp=-0,02′;
line33=’TABLE: "FRAME SECTION PROPERTIES 01 – GENERAL"’;
line34=’ SectionName=ExampleWideFlanged Material=BJ-37 Shape="I/Wide Flange" t3=0,25 t2=0,15 tf=0,012 tw=0,008 t2b=0,15 tfb=0,012 FilletRadius=0,012 Area=0,005552 TorsConst=2,13418666666667E-07 I33=6,04638656154112E-05 _’;
line35=’ I22=6,76749435145855E-06 I23=-6,7762635780344E-21 AS2=0,00200790111881035 AS3=0,00357344416053972 S33Top=0,00048371092492329 S33Bot=0,00048371092492329 S22Left=9,02332580194473E-05 S22Right=9,02332580194473E-05 _’;
line36=’ Z33=0,000546402338734841 Z22=0,00013961366126516 R33=0,10435739412628 R22=0,0349131651083826 CGOffset3=-1,38777878078145E-17 CGOffset2=5,55111512312578E-17 EccV2=0 EccV3=0 Cw=9,558675E-08 ConcCol=No ConcBeam=No _’;
line37=’ Color=Blue TotalWt=60,3707599671425 TotalMass=6,15610399662034 FromFile=No AMod=1 A2Mod=1 A3Mod=1 JMod=1 I2Mod=1 I3Mod=1 MMod=1 WMod=1 Notes="Added 03/04/2024 20:08:55′;
line38=’TABLE: "LOAD PATTERN DEFINITIONS"’;
line39=’ LoadPat=DEAD DesignType=Dead SelfWtMult=1 GUID=d2c74fc0-a771-416d-b3dc-4b0a2047268d’;
line40=’ LoadPat=SUPERDEAD DesignType="Super Dead" SelfWtMult=0 GUID=91534b51-672f-4fb0-a037-d7225de00c69 Notes="Added 01/02/2024 20:08:11"’;
line41=’ LoadPat=LIVE DesignType=Live SelfWtMult=0 GUID=1f6f6fd1-e0f1-4fcb-bf3d-dc86bd53f1a8 Notes="Added 01/02/2024 20:08:16"’;
line42=’TABLE: "GROUPS 1 – DEFINITIONS"’;
line43=’ GroupName=All Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line44=’ GroupName=ST_Top Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line45=’ GroupName=ST_Bot Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line46=’ GroupName=ST_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line47=’ GroupName=ST_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line48=’ GroupName=OT_Top1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line49=’ GroupName=OT_Top2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Yellow’;
line49a=’ GroupName=OT_Bot1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line49b=’ GroupName=OT_Bot2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line49c=’ GroupName=OT_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line49d=’ GroupName=OT_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line49e=’ GroupName=Column_End Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line50=’TABLE: "JOINT PATTERN DEFINITIONS"’;
line51=’ Pattern=Default’;
line52=’TABLE: "MASS SOURCE"’;
line53=’ MassSource=MSSSRC1 Elements=Yes Masses=Yes Loads=Yes IsDefault=Yes LoadPat=DEAD Multiplier=1′;
line54=’ MassSource=MSSSRC1 LoadPat=SUPERDEAD Multiplier=1′;
line55=’ MassSource=MSSSRC1 LoadPat=LIVE Multiplier=0,5′;
line56=’TABLE: "LOAD CASE DEFINITIONS"’;
line57=’ Case=DEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=91b91585-f6e6-446e-ac30-362013fd8af9′;
line58=’ Case=MODAL Type=LinModal InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Other DesActOpt="Prog Det" DesignAct=Other AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=3e160405-efbf-45fb-ae06-c6da634ca183′;
line59=’ Case=SUPERDEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType="Super Dead" DesActOpt="Prog Det" DesignAct="Long-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=2ca565b7-af73-42e9-9208-0a0739594699′;
line60=’ Case=LIVE Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Live DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e969dd8f-56cc-40d7-af8a-0fba39157fcb’;
line61=’ Case="Gravity NLS" Type=NonStatic InitialCond=Zero MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line62=’ Case=Pushover-UX Type=NonStatic InitialCond="Gravity NLS" MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Quake DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line63=’TABLE: "CASE – STATIC 1 – LOAD ASSIGNMENTS"’;
line64=’ Case=DEAD LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line65=’ Case=SUPERDEAD LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line66=’ Case=LIVE LoadType="Load pattern" LoadName=LIVE LoadSF=1′;
line67=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line68=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line69=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=LIVE LoadSF=0,5′;
line70=’ Case=Pushover-UX LoadType=Accel LoadName="Accel UX" TransAccSF=-1′;
line71=’TABLE: "CASE – STATIC 2 – NONLINEAR LOAD APPLICATION"’;
line72=’ Case="Gravity NLS" LoadApp="Full Load" MonitorDOF=U1 MonitorJt=9′;
line73=’ Case=Pushover-UX LoadApp="Displ Ctrl" DisplType=Monitored TargetDispl=1 MonitorDOF=U1 MonitorJt=9′;
line74=’TABLE: "CASE – STATIC 4 – NONLINEAR PARAMETERS"’;
line75=’ Case="Gravity NLS" GeoNonLin=P-Delta ResultsSave="Final State" SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 _’;
line76=’ TFAccelFact=1 TFNoStop=No’;
line77=’ Case=Pushover-UX GeoNonLin=P-Delta ResultsSave="Multiple States" MinNumState=10 MaxNumState=100 PosIncOnly=Yes SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 _’;
line78=’ MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 TFAccelFact=1 TFNoStop=No’;
line79=’TABLE: "CASE – MODAL 1 – GENERAL"’;
line80=’ Case=MODAL ModeType=Eigen MaxNumModes=12 MinNumModes=1 EigenShift=0 EigenCutoff=0 EigenTol=1E-09 AutoShift=Yes’;
line81=’TABLE: "JOINT COORDINATES"’;
line82= append(txtjointBASE(i),newline,txtjointCOLUMN(i),newline,txtjointTOS(i),newline,txtjointBOS(i),newline,txtjointTSS(i),newline,txtjointBSS(i));
line83=’TABLE: "CONNECTIVITY – FRAME"’;
line84= append(txtframeCOLUMN(i),newline,txtframeTOS(i),newline,txtframeBOS(i),newline,txtframeTSS(i),newline,txtframeBSS(i),newline,txtframeDOS(i),newline,txtframeDSS(i),newline,txtframeVSS(i));
line85=’TABLE: "END TABLE DATA"’;
combine1 = append(line1,newline,line2,newline,line3,newline,line4,newline,line5,newline,line6,newline,line7,newline,line8,newline,line9,newline,line10,newline,line11,newline,line12,newline,line13,newline,line14,newline,line15,newline,line16,newline,line17,newline,line18,newline,line19,newline,line20,newline,line21,newline,line22,newline,line23,newline,line24,newline,line25,newline,line26,newline,line27,newline,line28,newline,line29,newline,line30,newline,line31,newline,line32,newline,line33,newline,line34,newline,line35,newline,line36);
combine2 = append(combine1,newline,line37,newline,line38,newline,line39,newline,line40,newline,line41,newline,line42,newline,line43,newline,line44,newline,line45,newline,line46,newline,line47,newline,line48,newline,line49,newline,line49a,newline,line49b,newline,line49c,newline,line49d,newline,line49e,newline,line50,newline,line51,newline,line52,newline,line53,newline,line54,newline,line55,newline,line56,newline,line57,newline,line58,newline,line59,newline,line60,newline,line61,newline,line62,newline,line63,newline,line64,newline,line65,newline,line66,newline,line67,newline,line68,newline);
combine3 = append(combine2,line69,newline,line70,newline,line71,newline,line72,newline,line73,newline,line74,newline,line75,newline,line76,newline,line77,newline,line78,newline,line79,newline,line80,newline,line81,newline,line82,newline,line83,newline,line84,newline,line85);
fprintf(fido,combine3,C);
fclose(fido);
end
error : Unrecognized function or variable
‘txtjointBASE’.
Error in cobadoang5_1>writefile (line 579)
line82= append(txtjointBASE(i),newline,txtjointCOLUMN(i),newline,txtjointTOS(i),newline,txtjointBOS(i),newline,txtjointTSS(i),newline,txtjointBSS(i));
Error in cobadoang5_1 (line 484)
writefile(VariantModel{i}); Hi guys, im facing difficulity when i export text from variable string array to files using fucntion. It happens error because fucntion cant call the variable which i defined. I want to make many files (total 75) and each file contains text like this :
here i give my script :
clear;
clc;
H = 5;
L = 15;
Ns = 2;
Nb = 1;
PortalHeight = H;
Bayspan = L;
NumberStory = Ns;
NumberBay = Nb;
% Variable1
h = [0.8,1.00,1.20,1.40,1.6,1.80];
% Variable2
Lss = [2.00,2.40,2.80,3.20,3.60,4.00];
% Variable3
Nss = [2,3,4];
% Definition
Var1HeightofTrussBeam = h;
Var2LengthSpecialSegment = Lss;
Var3NumberSpecialSegment = Nss;
% % Xbase = zeros(1,length(Totalvariant));
% % Zbase = zeros(1,length(Totalvariant));
% % Xcol = zeros(1,length(Totalvariant));
% % Zcol = zeros(1,length(Totalvariant));
% % Xos = zeros(1,length(Totalvariant));
% % Zos = zeros(1,length(Totalvariant));
% % Xss = zeros(1,length(Totalvariant));
% % Zss = zeros(1,length(Totalvariant));
% % X = zeros(1,length(Totalvariant));
% % Z = zeros(1,length(Totalvariant));
% % jointbase = zeros(1,length(Totalvariant));
% % jointcolumn = zeros(1,length(Totalvariant));
% % jointordinarysegment = zeros(1,length(Totalvariant));
% % jointtopordinarysegment = zeros(1,length(Totalvariant));
% % jointbottomordinarysegment = zeros(1,length(Totalvariant));
% % jointspecialsegment = zeros(1,length(Totalvariant));
% % jointtopspecialsegment = zeros(1,length(Totalvariant));
% % jointbottomspecialsegment = zeros(1,length(Totalvariant));
ijk = 0;
for i = 1:numel(h)
for j = 1:numel(Lss)
for k = 1:numel(Nss)
ijk = ijk+1;
Variantmodel{ijk,:} = table(ijk,h(i),Lss(j),Nss(k),’VariableNames’,{‘VariantID’,’Height’,’Length’,’Number’});
%% Cooridinate Point Base(base)
Xbase{ijk,:} = L*(0:NumberBay);
Zbase{ijk,:} = repelem(0,1,length(Xbase{ijk,:}));
%% Column(col)
Xcolumn = L*(0:NumberBay);
Zcolumn = repelem(H*(1:NumberStory),1,length(Xcolumn));
Xbotbeam = L*(0:NumberBay);
Zbotbeam = repelem((H*(1:NumberStory)-h(i)),1,length(Xbotbeam));
idx = unique(Zbotbeam(:).’);
Zbottombeam{ijk,:} = idx;
% replicate [X] to be the same size as [Z] for plotting:
Xcol{ijk,:} = repmat([Xcolumn,Xbotbeam],1,NumberStory);
Zcol{ijk,:} = [Zcolumn,Zbotbeam];
%% Cooridinate Point Ordinary Segment (os)
% calculate span length of ordinary segment
Los = (L-Lss(j))/2;
Nos = Los/h(i);
Nos = round(Nos);
los = Los/Nos;
totalspan{ijk,:} = los*Nos*2+Lss(j);
if totalspan{ijk,:} == 15.000
checkspan{ijk,:} = "correct span";
else
checkspan{ijk,:} = "span must be 15m";
end
% top and bottom joint of ordinary segment(os)
XTopOrdinarySegment = reshape([los*(1:Nos),(L/2+Lss(j)/2)+los*(0:Nos-1)].’+L*(0:(NumberBay-1)),1,[]);
XBottomOrdinarySegment = XTopOrdinarySegment;
ZTopOrdinarySegment = repelem(H*(1:NumberStory),1,2*Nos*NumberBay);
ZBottomOrdinarySegment = repelem(H*(1:NumberStory)-h(i),1,2*Nos*NumberBay);
% replicate [X] to be the same size as [Z] for plotting:
Xos{ijk,:} = repmat([XTopOrdinarySegment,XBottomOrdinarySegment],1,NumberStory);
Zos{ijk,:} = [ZTopOrdinarySegment,ZBottomOrdinarySegment];
%% Cooridinate Point Special Segment (ss)
% calculate span length of special segment
lss = Lss(j)/Nss(k);
% top and bottom joint of special segment(ss)
XTopSpecialSegment = reshape((lss*(0:Nss(k))+L/2-Lss(j)/2).’+L*(0:(NumberBay-1)),1,[]);
XBottomSpecialSegment = XTopSpecialSegment;
ZTopSpecialSegment = repelem(H*(1:NumberStory),1,length(XTopSpecialSegment));
ZBottomSpecialSegment = repelem(H*(1:NumberStory)-h(i),1,length(XBottomSpecialSegment));
% replicate [X] to be the same size as [Z] for plotting:
Xss{ijk,:} = repmat([XTopSpecialSegment,XBottomSpecialSegment],1,NumberStory);
Zss{ijk,:} = [ZTopSpecialSegment,ZBottomSpecialSegment];
%% Plot Cooridinate Point (X,Z)
X{ijk,:} = [Xbase{ijk,:},Xcol{ijk,:},Xos{ijk,:},Xss{ijk,:}];
Z{ijk,:} = [Zbase{ijk,:},Zcol{ijk,:},Zos{ijk,:},Zss{ijk,:}];
scatter(X{ijk,:},Z{ijk,:},’filled’),grid on
%check angle
tangent = (Lss(j)/Nss(k))/h(i);
anglespecialsegment(ijk) = atand(tangent);
%% Name the Joint
jointbase{ijk} = table((1:numel(Xbase{ijk,:}))’,Xbase{ijk,:}’,Zbase{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointcolumn{ijk} = table((max(jointbase{ijk}.ID)+1:numel(Xcol{ijk,:})+max(jointbase{ijk}.ID))’,Xcol{ijk,:}’,Zcol{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointordinarysegment{ijk} = table((max(jointcolumn{ijk}.ID)+1:numel(Xos{ijk,:})+max(jointcolumn{ijk}.ID))’,Xos{ijk,:}’,Zos{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zcolumn),:);
jointbottomordinarysegment{ijk} = jointordinarysegment{ijk}(ismember(jointordinarysegment{ijk}.Z,Zbotbeam),:);
jointspecialsegment{ijk} = table((max(jointbottomordinarysegment{ijk}.ID)+1:numel(Xss{ijk,:})+max(jointbottomordinarysegment{ijk}.ID))’,Xss{ijk,:}’,Zss{ijk,:}’,’VariableNames’,{‘ID’,’X’,’Z’});
jointtopspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zcolumn),:);
jointbottomspecialsegment{ijk} = jointspecialsegment{ijk}(ismember(jointspecialsegment{ijk}.Z,Zbotbeam),:);
end
end
end
% Verify Variants Which Passed the Angle Requirement
tablecheck = table((1:numel(anglespecialsegment))’,totalspan,anglespecialsegment’,’VariableNames’,{‘VariantID’,’Total Span’,’Angle’});
VariantIDPassed = tablecheck.VariantID(tablecheck.Angle>=30 & tablecheck.Angle<=60);
jointbase = table((1:numel(jointbase))’,jointbase’,’VariableNames’,{‘VariantID’,’Joint Base’});
jointbase = jointbase(ismember(jointbase.VariantID,VariantIDPassed),:);
jointcolumn = table((1:numel(jointcolumn))’,jointcolumn’,’VariableNames’,{‘VariantID’,’Joint Column’});
jointcolumn = jointcolumn(ismember(jointcolumn.VariantID,VariantIDPassed),:);
jointtopordinarysegment = table((1:numel(jointtopordinarysegment))’,jointtopordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Top Ordinary Segment’});
jointtopordinarysegment = jointtopordinarysegment(ismember(jointtopordinarysegment.VariantID,VariantIDPassed),:);
jointbottomordinarysegment = table((1:numel(jointbottomordinarysegment))’,jointbottomordinarysegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Ordinary Segment’});
jointbottomordinarysegment = jointbottomordinarysegment(ismember(jointbottomordinarysegment.VariantID,VariantIDPassed),:);
jointtopspecialsegment = table((1:numel(jointtopspecialsegment))’,jointtopspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Top Special Segment’});
jointtopspecialsegment = jointtopspecialsegment(ismember(jointtopspecialsegment.VariantID,VariantIDPassed),:);
jointbottomspecialsegment = table((1:numel(jointbottomspecialsegment))’,jointbottomspecialsegment’,’VariableNames’,{‘VariantID’,’Joint Bottom Special Segment’});
jointbottomspecialsegment = jointbottomspecialsegment(ismember(jointbottomspecialsegment.VariantID,VariantIDPassed),:);
Zbottombeam{ijk} = table((1:numel(Zbottombeam{ijk,:}))’,Zbottombeam{ijk,:}’,’VariableNames’,{‘VariantID’,’Z Bottom Beam’});
Zbottombeam = Zbottombeam(VariantIDPassed);
%% Name the Frame
% column
for i = 1:height(VariantIDPassed)
jointIcolumn = 0;
jointJcolumn = 0;
jointcolumnnew{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointcolumnnew{i,:} = vertcat(jointbase.("Joint Base"){i},jointcolumnnew{i});
for j = 1:height(jointcolumnnew{i,1})-2
jointIcolumn(j) = jointcolumnnew{i,1}.ID(j);
jointJcolumn(j) = jointcolumnnew{i,1}.ID(j+2);
end
framecolumn{i,:} = table((1:j)’,jointIcolumn’,jointJcolumn’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Name the Frame
% top ordinary segment (TOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endTOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointtopordinarysegment.("Joint Top Ordinary Segment"){i}.Z),:);
jointTOS{i,:} = vertcat(jointtopordinarysegment.("Joint Top Ordinary Segment"){i},endTOS{i});
jointTOSnew1{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H),:),2);
jointTOSnew2{i,:} = sortrows(jointTOS{i}(ismember(jointTOS{i}.Z,H*Ns),:),2);
jointTOSnew{i,:} = vertcat(jointTOSnew1{i},jointTOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew1{i,1})-1
jointI(j) = jointTOSnew1{i,1}.ID(j);
jointJ(j) = jointTOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(framecolumn{i,1}.("Frame ID"));
frameTOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS1{i,1}(median(1:height(frameTOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTOSnew2{i,1})-1
jointI(j) = jointTOSnew2{i,1}.ID(j);
jointJ(j) = jointTOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS1{i,1}.("Frame ID"));
frameTOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameTOS2{i,1}(median(1:height(frameTOS2{i,1})),:) = [];
end
frameTOS = cellfun(@(varargin)vertcat(varargin{:}),frameTOS1,frameTOS2,’UniformOutput’,false);
%% Name the Frame
% bottom ordinary segment (BOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
endBOS{i,:} = jointcolumn.("Joint Column"){i}(ismember(jointcolumn.("Joint Column"){i}.Z,jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i}.Z),:);
jointBOS{i,:} = vertcat(jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i},endBOS{i});
jointBOSnew1{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(1)),:),2);
jointBOSnew2{i,:} = sortrows(jointBOS{i}(ismember(jointBOS{i}.Z,Zbottombeam{i}(2)),:),2);
jointBOSnew{i,:} = vertcat(jointBOSnew1{i},jointBOSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBOSnew1{i,1})-1
jointI(j) = jointBOSnew1{i,1}.ID(j);
jointJ(j) = jointBOSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTOS{i,1}.("Frame ID"));
frameBOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS1{i,1}(median(1:height(frameBOS1{i,1})),:) = [];
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ =0;
for j = 1:height(jointBOSnew2{i,1})-1
jointI(j) = jointBOSnew2{i,1}.ID(j);
jointJ(j) = jointBOSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS1{i,1}.("Frame ID"));
frameBOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
%eliminate special segment
frameBOS2{i,1}(median(1:height(frameBOS2{i,1})),:) = [];
end
frameBOS = cellfun(@(varargin)vertcat(varargin{:}),frameBOS1,frameBOS2,’UniformOutput’,false);
%% Name the Frame
% top special segment (TSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointTSSnew1{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H),:),2);
jointTSSnew2{i,:} = sortrows(jointtopspecialsegment.("Joint Top Special Segment"){i,1}(ismember(jointtopspecialsegment.("Joint Top Special Segment"){i,1}.Z,H*Ns),:),2);
jointTSSnew{i,:} = vertcat(jointTSSnew1{i},jointTSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew1{i,1})-1
jointI(j) = jointTSSnew1{i,1}.ID(j);
jointJ(j) = jointTSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBOS{i,1}.("Frame ID"));
frameTSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointTSSnew2{i,1})-1
jointI(j) = jointTSSnew2{i,1}.ID(j);
jointJ(j) = jointTSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS1{i,1}.("Frame ID"));
frameTSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameTSS = cellfun(@(varargin)vertcat(varargin{:}),frameTSS1,frameTSS2,’UniformOutput’,false);
%% Name the Frame
% bottom special segment (BSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
jointBSSnew1{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(1)),:),2);
jointBSSnew2{i,:} = sortrows(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}(ismember(jointbottomspecialsegment.("Joint Bottom Special Segment"){i,1}.Z,Zbottombeam{i}(2)),:),2);
jointBSSnew{i,:} = vertcat(jointBSSnew1{i},jointBSSnew2{i});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew1{i,1})-1
jointI(j) = jointBSSnew1{i,1}.ID(j);
jointJ(j) = jointBSSnew1{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameTSS{i,1}.("Frame ID"));
frameBSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(jointBSSnew2{i,1})-1
jointI(j) = jointBSSnew2{i,1}.ID(j);
jointJ(j) = jointBSSnew2{i,1}.ID(j+1);
end
lastframenumber{i,:} = max(frameBSS1{i,1}.("Frame ID"));
frameBSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameBSS = cellfun(@(varargin)vertcat(varargin{:}),frameBSS1,frameBSS2,’UniformOutput’,false);
%% Name the Frame
% diagonal ordinary segment (DOS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tosleft{i,:} = frameTOS{i,1}(1:2:end,:);
tosright{i,:} = frameTOS{i,1}(2:2:end,:);
bosleft{i,:} = frameBOS{i,1}(1:2:end,:);
bosright{i,:} = frameBOS{i,1}(2:2:end,:);
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tosleft{i,1})
jointI(j) = tosleft{i,1}.JointI(j);
jointJ(j) = bosleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameBSS{i,1}.("Frame ID"));
frameDOS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bosright{i,1})
jointI(j) = bosright{i,1}.JointI(j);
jointJ(j) = tosright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS1{i,1}.("Frame ID"));
frameDOS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDOS = cellfun(@(varargin)vertcat(varargin{:}),frameDOS1,frameDOS2,’UniformOutput’,false);
%% Name the Frame
% diagonal special segment (DSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
tssright{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
bssright{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDOS{i,1}.("Frame ID"));
frameDSS1{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(bssright{i,1})
jointI(j) = bssright{i,1}.JointI(j);
jointJ(j) = tssright{i,1}.JointJ(j);
end
lastframenumber{i,:} = max(frameDSS1{i,1}.("Frame ID"));
frameDSS2{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
frameDSS = cellfun(@(varargin)vertcat(varargin{:}),frameDSS1,frameDSS2,’UniformOutput’,false);
%% Name the Frame
% vertical special segment (VSS) (this phase is not automatic for different story)
for i = 1:height(VariantIDPassed)
tssleft{i,:} = frameTSS{i,1};
bssleft{i,:} = frameBSS{i,1};
end
for i = 1:height(VariantIDPassed)
jointI = 0;
jointJ = 0;
for j = 1:height(tssleft{i,1})
jointI(j) = tssleft{i,1}.JointI(j);
jointJ(j) = bssleft{i,1}.JointI(j);
end
lastframenumber{i,:} = max(frameDSS{i,1}.("Frame ID"));
frameVSS{i,:} = table((lastframenumber{i}+1:lastframenumber{i}+j)’,jointI’,jointJ’,’VariableNames’,{‘Frame ID’,’JointI’,’JointJ’});
end
%% Print ‘frame’ data to textline
txtframeCOLUMN = strings(height(framecolumn),1);
for i = 1:height(framecolumn)
T = framecolumn{i};
M = T{:,:};
txtframeCOLUMN(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTOS = strings(height(frameTOS),1);
for i = 1:height(frameTOS)
T = frameTOS{i};
M = T{:,:};
txtframeTOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBOS = strings(height(frameBOS),1);
for i = 1:height(frameBOS)
T = frameBOS{i};
M = T{:,:};
txtframeBOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeTSS = strings(height(frameTSS),1);
for i = 1:height(frameTSS)
T = frameTSS{i};
M = T{:,:};
txtframeTSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeBSS = strings(height(frameBSS),1);
for i = 1:height(frameBSS)
T = frameBSS{i};
M = T{:,:};
txtframeBSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDOS = strings(height(frameDOS),1);
for i = 1:height(frameDOS)
T = frameDOS{i};
M = T{:,:};
txtframeDOS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeDSS = strings(height(frameDSS),1);
for i = 1:height(frameDSS)
T = frameDSS{i};
M = T{:,:};
txtframeDSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
txtframeVSS = strings(height(frameVSS),1);
for i = 1:height(frameVSS)
T = frameVSS{i};
M = T{:,:};
txtframeVSS(i) = sprintf(" Frame=%d JointI=%d JointJ=%d IsCurved=No n",M.’);
end
%% Print ‘joint’ data to textline
txtjointBASE = strings(height(jointbase),1);
for i = 1:height(jointbase)
T = jointbase.("Joint Base"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBASE(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointCOLUMN = strings(height(jointcolumn),1);
for i = 1:height(jointcolumn)
T = jointcolumn.("Joint Column"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointCOLUMN(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTOS = strings(height(jointtopordinarysegment),1);
for i = 1:height(jointtopordinarysegment)
T = jointtopordinarysegment.("Joint Top Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBOS = strings(height(jointbottomordinarysegment),1);
for i = 1:height(jointbottomordinarysegment)
T = jointbottomordinarysegment.("Joint Bottom Ordinary Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBOS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointTSS = strings(height(jointtopspecialsegment),1);
for i = 1:height(jointtopspecialsegment)
T = jointtopspecialsegment.("Joint Top Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointTSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
txtjointBSS = strings(height(jointbottomspecialsegment),1);
for i = 1:height(jointbottomspecialsegment)
T = jointbottomspecialsegment.("Joint Bottom Special Segment"){i};
M = T{:,:};
M(:,end+[1 2]) = M(:,[2 3]); % duplicate columns 2 and 3 into columns 4 and 5
txtjointBSS(i) = sprintf(" Joint=%d CoordSys=GLOBAL CoordType=Cartesian XorR=%1.3f Y=0 Z=%1.3f SpecialJt=No GlobalX=%1.3f GlobalY=0 GlobalZ=%1.3fn",M.’);
end
%% WRITE s2k Extension Files
VariantModel = compose(‘%d’, 1:height(VariantIDPassed));
for i = 1:numel(VariantModel)
writefile(VariantModel{i});
end
files = dir(‘*.s2k’);
files(:).name;
function writefile(C)
fido = fopen("ModelVariant"+C+".s2k",’wt’);
newline = ‘n’;
line1=’File D:MAGISTERKULIAHTESISS2K FILEModelVariant-%d.s2k was saved on m/d/yy at h:mm:ss’;
line2=’TABLE: "PROGRAM CONTROL"’;
line3=’ ProgramName=SAP2000 Version=25.0.0 ProgLevel=Ultimate LicenseNum=3010*1D6KZBK478DMQCT LicenseOS=Yes LicenseSC=Yes LicenseHT=No CurrUnits="KN, m, C" SteelCode="AISC 360-10" ConcCode="ACI 318-19" AlumCode="AA 2015" _’;
line4=’ ColdCode=AISI-16 RegenHinge=Yes’;
line5=’TABLE: "ACTIVE DEGREES OF FREEDOM"’;
line6=’ UX=Yes UY=No UZ=Yes RX=No RY=Yes RZ=No’;
line7=’TABLE: "ANALYSIS OPTIONS"’;
line8=’ Solver=Multithreaded SolverProc="Analysis Process" NumParallel=0 Force32Bit=No StiffCase=None GeomMod=None HingeOpt="In Elements" NumAThreads=0 MaxFileSize=0 NumDThreads=0 NumRThreads=0 _ UseMMFiles="Program Determined" AllowDiff=No’;
line9=’TABLE: "COORDINATE SYSTEMS"’;
line10=’ Name=GLOBAL Type=Cartesian X=0 Y=0 Z=0 AboutZ=0 AboutY=0 AboutX=0′;
line11=’TABLE: "GRID LINES"’;
line12=’ CoordSys=GLOBAL AxisDir=X GridID=A XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End AllVisible=Yes BubbleSize=1,5′;
line13=’ CoordSys=GLOBAL AxisDir=X GridID=B XRYZCoord=15 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line14=’ CoordSys=GLOBAL AxisDir=X GridID=C XRYZCoord=30 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line15=’ CoordSys=GLOBAL AxisDir=Y GridID=1 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=Start’;
line16=’ CoordSys=GLOBAL AxisDir=Z GridID=Z0 XRYZCoord=0 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line17=’ CoordSys=GLOBAL AxisDir=Z GridID=Z1 XRYZCoord=5 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line18=’ CoordSys=GLOBAL AxisDir=Z GridID=Z2 XRYZCoord=10 LineType=Primary LineColor=Gray8Dark Visible=Yes BubbleLoc=End’;
line19=’TABLE: "MATERIAL PROPERTIES 01 – GENERAL"’;
line20=’ Material=4000Psi Type=Concrete Grade="’ + "f’c 4000 " + ‘psi"’+ ‘ SymType=Isotropic TempDepend=No Color=Green GUID=b0920fc0-a39b-46e4-a096-037f0f0739a7 Notes="Customary ‘+"f’c 4000 psi "+’01/02/2024 20:13:33"’;
line21=’ Material=BJ-37 Type=Steel Grade="Grade 50" SymType=Isotropic TempDepend=No Color=Magenta Notes="ASTM A992 Grade 50 01/02/2024 20:03:34"’;
line22=’TABLE: "MATERIAL PROPERTIES 02 – BASIC MECHANICAL PROPERTIES"’;
line23=’ Material=4000Psi UnitWeight=23,5631216161854 UnitMass=2,40276960558926 E1=24855578,0600518 G12=10356490,8583549 U12=0,2 A1=9,89999952793124E-06′;
line24=’ Material=BJ-37 UnitWeight=76,9728639422648 UnitMass=7,84904737995992 E1=199947978,795958 G12=76903068,7676762 U12=0,3 A1=1,16999994421006E-05′;
line25=’TABLE: "MATERIAL PROPERTIES 03A – STEEL DATA"’;
line26=’ Material=BJ-37 Fy=235000 Fu=352500 EffFy=235000 EffFu=352500 SSCurveOpt=Simple SSHysType=Kinematic SHard=0,015 SMax=0,11 SRup=0,17 FinalSlope=-0,1 CoupModType="Von Mises"’;
line27=’TABLE: "MATERIAL PROPERTIES 06 – DAMPING PARAMETERS"’;
line28=’ Material=4000Psi ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line29=’ Material=BJ-37 ModalRatio=0 VisMass=0 VisStiff=0 HysMass=0 HysStiff=0′;
line30=’TABLE: "MATERIAL PROPERTIES 09 – ACCEPTANCE CRITERIA"’;
line31=’ Material=4000Psi IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,003 LSComp=-0,006 CPComp=-0,015 IgnoreTens=Yes’;
line32=’ Material=BJ-37 IOTens=0,01 LSTens=0,02 CPTens=0,05 IOComp=-0,005 LSComp=-0,01 CPComp=-0,02′;
line33=’TABLE: "FRAME SECTION PROPERTIES 01 – GENERAL"’;
line34=’ SectionName=ExampleWideFlanged Material=BJ-37 Shape="I/Wide Flange" t3=0,25 t2=0,15 tf=0,012 tw=0,008 t2b=0,15 tfb=0,012 FilletRadius=0,012 Area=0,005552 TorsConst=2,13418666666667E-07 I33=6,04638656154112E-05 _’;
line35=’ I22=6,76749435145855E-06 I23=-6,7762635780344E-21 AS2=0,00200790111881035 AS3=0,00357344416053972 S33Top=0,00048371092492329 S33Bot=0,00048371092492329 S22Left=9,02332580194473E-05 S22Right=9,02332580194473E-05 _’;
line36=’ Z33=0,000546402338734841 Z22=0,00013961366126516 R33=0,10435739412628 R22=0,0349131651083826 CGOffset3=-1,38777878078145E-17 CGOffset2=5,55111512312578E-17 EccV2=0 EccV3=0 Cw=9,558675E-08 ConcCol=No ConcBeam=No _’;
line37=’ Color=Blue TotalWt=60,3707599671425 TotalMass=6,15610399662034 FromFile=No AMod=1 A2Mod=1 A3Mod=1 JMod=1 I2Mod=1 I3Mod=1 MMod=1 WMod=1 Notes="Added 03/04/2024 20:08:55′;
line38=’TABLE: "LOAD PATTERN DEFINITIONS"’;
line39=’ LoadPat=DEAD DesignType=Dead SelfWtMult=1 GUID=d2c74fc0-a771-416d-b3dc-4b0a2047268d’;
line40=’ LoadPat=SUPERDEAD DesignType="Super Dead" SelfWtMult=0 GUID=91534b51-672f-4fb0-a037-d7225de00c69 Notes="Added 01/02/2024 20:08:11"’;
line41=’ LoadPat=LIVE DesignType=Live SelfWtMult=0 GUID=1f6f6fd1-e0f1-4fcb-bf3d-dc86bd53f1a8 Notes="Added 01/02/2024 20:08:16"’;
line42=’TABLE: "GROUPS 1 – DEFINITIONS"’;
line43=’ GroupName=All Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line44=’ GroupName=ST_Top Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line45=’ GroupName=ST_Bot Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line46=’ GroupName=ST_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line47=’ GroupName=ST_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line48=’ GroupName=OT_Top1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line49=’ GroupName=OT_Top2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Yellow’;
line49a=’ GroupName=OT_Bot1 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Gray8Dark’;
line49b=’ GroupName=OT_Bot2 Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Blue’;
line49c=’ GroupName=OT_Ver Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Green’;
line49d=’ GroupName=OT_Diag Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Cyan’;
line49e=’ GroupName=Column_End Selection=Yes SectionCut=Yes Steel=Yes Concrete=Yes Aluminum=Yes ColdFormed=Yes Stage=Yes Bridge=Yes AutoSeismic=No AutoWind=No SelDesSteel=No SelDesAlum=No SelDesCold=No MassWeight=Yes Color=Red’;
line50=’TABLE: "JOINT PATTERN DEFINITIONS"’;
line51=’ Pattern=Default’;
line52=’TABLE: "MASS SOURCE"’;
line53=’ MassSource=MSSSRC1 Elements=Yes Masses=Yes Loads=Yes IsDefault=Yes LoadPat=DEAD Multiplier=1′;
line54=’ MassSource=MSSSRC1 LoadPat=SUPERDEAD Multiplier=1′;
line55=’ MassSource=MSSSRC1 LoadPat=LIVE Multiplier=0,5′;
line56=’TABLE: "LOAD CASE DEFINITIONS"’;
line57=’ Case=DEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=91b91585-f6e6-446e-ac30-362013fd8af9′;
line58=’ Case=MODAL Type=LinModal InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Other DesActOpt="Prog Det" DesignAct=Other AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=3e160405-efbf-45fb-ae06-c6da634ca183′;
line59=’ Case=SUPERDEAD Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType="Super Dead" DesActOpt="Prog Det" DesignAct="Long-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=2ca565b7-af73-42e9-9208-0a0739594699′;
line60=’ Case=LIVE Type=LinStatic InitialCond=Zero DesTypeOpt="Prog Det" DesignType=Live DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e969dd8f-56cc-40d7-af8a-0fba39157fcb’;
line61=’ Case="Gravity NLS" Type=NonStatic InitialCond=Zero MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Dead DesActOpt="Prog Det" DesignAct=Non-Composite AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line62=’ Case=Pushover-UX Type=NonStatic InitialCond="Gravity NLS" MassSource=MSSSRC1 DesTypeOpt="Prog Det" DesignType=Quake DesActOpt="Prog Det" DesignAct="Short-Term Composite" AutoType=None RunCase=Yes CaseStatus="Not Run" GUID=e13dc273-9465-4be3-a170-d60ddec6e3ae’;
line63=’TABLE: "CASE – STATIC 1 – LOAD ASSIGNMENTS"’;
line64=’ Case=DEAD LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line65=’ Case=SUPERDEAD LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line66=’ Case=LIVE LoadType="Load pattern" LoadName=LIVE LoadSF=1′;
line67=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=DEAD LoadSF=1′;
line68=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=SUPERDEAD LoadSF=1′;
line69=’ Case="Gravity NLS" LoadType="Load pattern" LoadName=LIVE LoadSF=0,5′;
line70=’ Case=Pushover-UX LoadType=Accel LoadName="Accel UX" TransAccSF=-1′;
line71=’TABLE: "CASE – STATIC 2 – NONLINEAR LOAD APPLICATION"’;
line72=’ Case="Gravity NLS" LoadApp="Full Load" MonitorDOF=U1 MonitorJt=9′;
line73=’ Case=Pushover-UX LoadApp="Displ Ctrl" DisplType=Monitored TargetDispl=1 MonitorDOF=U1 MonitorJt=9′;
line74=’TABLE: "CASE – STATIC 4 – NONLINEAR PARAMETERS"’;
line75=’ Case="Gravity NLS" GeoNonLin=P-Delta ResultsSave="Final State" SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 _’;
line76=’ TFAccelFact=1 TFNoStop=No’;
line77=’ Case=Pushover-UX GeoNonLin=P-Delta ResultsSave="Multiple States" MinNumState=10 MaxNumState=100 PosIncOnly=Yes SolScheme="Iterative Events" MaxTotal=200 MaxNull=50 EvLumpTol=0,01 MaxEvPerStp=24 MaxIterCS=10 _’;
line78=’ MaxIterNR=40 ItConvTol=0,0001 TFMaxIter=10 TFTol=0,01 TFAccelFact=1 TFNoStop=No’;
line79=’TABLE: "CASE – MODAL 1 – GENERAL"’;
line80=’ Case=MODAL ModeType=Eigen MaxNumModes=12 MinNumModes=1 EigenShift=0 EigenCutoff=0 EigenTol=1E-09 AutoShift=Yes’;
line81=’TABLE: "JOINT COORDINATES"’;
line82= append(txtjointBASE(i),newline,txtjointCOLUMN(i),newline,txtjointTOS(i),newline,txtjointBOS(i),newline,txtjointTSS(i),newline,txtjointBSS(i));
line83=’TABLE: "CONNECTIVITY – FRAME"’;
line84= append(txtframeCOLUMN(i),newline,txtframeTOS(i),newline,txtframeBOS(i),newline,txtframeTSS(i),newline,txtframeBSS(i),newline,txtframeDOS(i),newline,txtframeDSS(i),newline,txtframeVSS(i));
line85=’TABLE: "END TABLE DATA"’;
combine1 = append(line1,newline,line2,newline,line3,newline,line4,newline,line5,newline,line6,newline,line7,newline,line8,newline,line9,newline,line10,newline,line11,newline,line12,newline,line13,newline,line14,newline,line15,newline,line16,newline,line17,newline,line18,newline,line19,newline,line20,newline,line21,newline,line22,newline,line23,newline,line24,newline,line25,newline,line26,newline,line27,newline,line28,newline,line29,newline,line30,newline,line31,newline,line32,newline,line33,newline,line34,newline,line35,newline,line36);
combine2 = append(combine1,newline,line37,newline,line38,newline,line39,newline,line40,newline,line41,newline,line42,newline,line43,newline,line44,newline,line45,newline,line46,newline,line47,newline,line48,newline,line49,newline,line49a,newline,line49b,newline,line49c,newline,line49d,newline,line49e,newline,line50,newline,line51,newline,line52,newline,line53,newline,line54,newline,line55,newline,line56,newline,line57,newline,line58,newline,line59,newline,line60,newline,line61,newline,line62,newline,line63,newline,line64,newline,line65,newline,line66,newline,line67,newline,line68,newline);
combine3 = append(combine2,line69,newline,line70,newline,line71,newline,line72,newline,line73,newline,line74,newline,line75,newline,line76,newline,line77,newline,line78,newline,line79,newline,line80,newline,line81,newline,line82,newline,line83,newline,line84,newline,line85);
fprintf(fido,combine3,C);
fclose(fido);
end
error : Unrecognized function or variable
‘txtjointBASE’.
Error in cobadoang5_1>writefile (line 579)
line82= append(txtjointBASE(i),newline,txtjointCOLUMN(i),newline,txtjointTOS(i),newline,txtjointBOS(i),newline,txtjointTSS(i),newline,txtjointBSS(i));
Error in cobadoang5_1 (line 484)
writefile(VariantModel{i}); fucntion, writefile, txt, text, string MATLAB Answers — New Questions
Multiplication of High Dimensional Matrices
Hello everyone!
I have a 4-D matrix and a 2-D matrix. I want to multiply the two and form a new 6-D matrix. Please see the following example.
corr_tauk=1:4;
corr_taun=1:4;
corr_tauc=1:4;
corr_g=1:4;
periods=2500;
vnodes_e=2000;
RtnDtr_e=randn(periods,vnodes_e);
r_itr=ones(length(corr_tauk),length(corr_taun),length(corr_tauc),length(corr_g));
Mtx_ridio=zeros(length(corr_tauk),length(corr_taun),length(corr_tauc),length(corr_g),periods,vnodes_e);
Now I confront a big problem to get Mtx_ridio. The idea is pointwise-multiplication to form an even higher dimensional matrix to reflect the cross-section at each period with each mix of parameters.
It seems like Mtx_ridio=r_itr.*RtnDtr_e, but definitely not.
Does anyone have an easy solution?Hello everyone!
I have a 4-D matrix and a 2-D matrix. I want to multiply the two and form a new 6-D matrix. Please see the following example.
corr_tauk=1:4;
corr_taun=1:4;
corr_tauc=1:4;
corr_g=1:4;
periods=2500;
vnodes_e=2000;
RtnDtr_e=randn(periods,vnodes_e);
r_itr=ones(length(corr_tauk),length(corr_taun),length(corr_tauc),length(corr_g));
Mtx_ridio=zeros(length(corr_tauk),length(corr_taun),length(corr_tauc),length(corr_g),periods,vnodes_e);
Now I confront a big problem to get Mtx_ridio. The idea is pointwise-multiplication to form an even higher dimensional matrix to reflect the cross-section at each period with each mix of parameters.
It seems like Mtx_ridio=r_itr.*RtnDtr_e, but definitely not.
Does anyone have an easy solution? Hello everyone!
I have a 4-D matrix and a 2-D matrix. I want to multiply the two and form a new 6-D matrix. Please see the following example.
corr_tauk=1:4;
corr_taun=1:4;
corr_tauc=1:4;
corr_g=1:4;
periods=2500;
vnodes_e=2000;
RtnDtr_e=randn(periods,vnodes_e);
r_itr=ones(length(corr_tauk),length(corr_taun),length(corr_tauc),length(corr_g));
Mtx_ridio=zeros(length(corr_tauk),length(corr_taun),length(corr_tauc),length(corr_g),periods,vnodes_e);
Now I confront a big problem to get Mtx_ridio. The idea is pointwise-multiplication to form an even higher dimensional matrix to reflect the cross-section at each period with each mix of parameters.
It seems like Mtx_ridio=r_itr.*RtnDtr_e, but definitely not.
Does anyone have an easy solution? multiplication of matrices MATLAB Answers — New Questions
Why do I get an out-of-memory error while training a deep learning network?
I am trying to train a convolutional neural network using the Deep Learning Toolbox. When I run the "trainnet" function, I get the following error.
Error using nnet.internal.cnngpu.convolveForward2D
Out of memory on device. To view more detail about available memory on the GPU, use ‘gpuDevice()’. If the problem persists, reset the GPU by calling ‘gpuDevice(1)’.
Why do I receive this error, and how can I resolve it?I am trying to train a convolutional neural network using the Deep Learning Toolbox. When I run the "trainnet" function, I get the following error.
Error using nnet.internal.cnngpu.convolveForward2D
Out of memory on device. To view more detail about available memory on the GPU, use ‘gpuDevice()’. If the problem persists, reset the GPU by calling ‘gpuDevice(1)’.
Why do I receive this error, and how can I resolve it? I am trying to train a convolutional neural network using the Deep Learning Toolbox. When I run the "trainnet" function, I get the following error.
Error using nnet.internal.cnngpu.convolveForward2D
Out of memory on device. To view more detail about available memory on the GPU, use ‘gpuDevice()’. If the problem persists, reset the GPU by calling ‘gpuDevice(1)’.
Why do I receive this error, and how can I resolve it? gpu, error, cnn, trainnet MATLAB Answers — New Questions
Image Reshape Error in MATLAB
How to correct the following error in MATLAB? Code attached.
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that
dimension.
Error in Rev2 (line 26)
decoded_image_low = reshape(decoded_low, size(lenna_gray));
clc;
clear all;
% Load the lenna image
lenna = imread(‘lenna.png’);
% Convert image to grayscale
lenna_gray = rgb2gray(lenna);
% Convert pixel values to bits
lenna_bits = reshape(de2bi(lenna_gray), [], 1);
% BPSK modulation
Eb_No_low = 0; % Low SNR
Eb_No_high = 4; % High SNR
SNR_low = 10^(Eb_No_low/10);
SNR_high = 10^(Eb_No_high/10);
% Transmit and receive at low SNR
received_low = awgn(double(lenna_bits), SNR_low, ‘measured’);
% Demodulation
decoded_low = received_low < 0;
% Reshape decoded bits to original image size
decoded_image_low = reshape(decoded_low, size(lenna_gray));
% Plot original and received image at low SNR
figure;
subplot(1,2,1); imshow(lenna_gray); title(‘Original Image’);
subplot(1,2,2); imshow(decoded_image_low); title(‘Received Image (0 dB SNR)’);
% Transmit and receive at high SNR
received_high = awgn(double(lenna_bits), SNR_high, ‘measured’);
% Demodulation
decoded_high = received_high < 0;
% Reshape decoded bits to original image size
decoded_image_high = reshape(decoded_high, size(lenna_gray));
% Plot original and received image at high SNR
figure;
subplot(1,2,1); imshow(lenna_gray); title(‘Original Image’);
subplot(1,2,2); imshow(decoded_image_high); title(‘Received Image (4 dB SNR)’);
% Linear error detection code
% Example: Hamming (7,4) code
parityMatrix = [1 1 1 0 1 0 0; 1 1 0 1 0 1 0; 1 0 1 1 0 0 1];
generatorMatrix = [eye(4) parityMatrix’];
% Encode the data
encoded_data = mod(lenna_bits * generatorMatrix, 2);
% Add noise for linear error detection code
received_data = awgn(double(encoded_data), Eb_No_low, ‘measured’);
% Syndrome lookup table for error detection
syndrome_table = syndtable(parityMatrix);
% Decoding with error detection
decoded_data = zeros(size(encoded_data));
errors = zeros(size(encoded_data, 1), 1);
for i = 1:size(encoded_data, 1)
syndrome = mod(received_data(i, 🙂 * parityMatrix’, 2);
if sum(syndrome) ~= 0 % Error detected
errors(i) = 1;
else
decoded_data(i, 🙂 = received_data(i, :);
end
end
% Count number of retransmission requests at different SNRs
SNRs = [0, 2, 4, 6, 8, 10];
retransmissions = zeros(size(SNRs));
for i = 1:length(SNRs)
SNR = 10^(SNRs(i)/10);
received_data = awgn(encoded_data, SNR, ‘measured’);
errors = zeros(size(encoded_data, 1), 1);
for j = 1:size(encoded_data, 1)
syndrome = mod(received_data(j, 🙂 * parityMatrix’, 2);
if sum(syndrome) ~= 0 % Error detected
errors(j) = 1;
retransmissions(i) = retransmissions(i) + 1;
end
end
end
% Plot number of retransmissions against SNR values
figure;
plot(SNRs, retransmissions, ‘-o’);
xlabel(‘SNR (dB)’);
ylabel(‘Number of Retransmissions’);
title(‘Number of Retransmissions vs SNR’);
% Error correction code
% Example: Reed-Solomon code
n = 255;
k = 223;
t = 16;
rs_encoder = comm.RSEncoder(n, k);
rs_decoder = comm.RSDecoder(n, k);
% Encode data
encoded_rs = step(rs_encoder, double(lenna_bits));
% Add noise for Reed-Solomon code
received_rs_low = awgn(double(encoded_rs), Eb_No_low, ‘measured’);
received_rs_high = awgn(double(encoded_rs), Eb_No_high, ‘measured’);
% Decode received data
decoded_rs_low = step(rs_decoder, received_rs_low);
decoded_rs_high = step(rs_decoder, received_rs_high);
% Reshape decoded bits to original image size
decoded_image_rs_low = reshape(decoded_rs_low, size(lenna_gray));
decoded_image_rs_high = reshape(decoded_rs_high, size(lenna_gray));
% Plot original and received images with error correction
figure;
subplot(1,2,1); imshow(decoded_image_low); title(‘Received Image (0 dB SNR, No Error Correction)’);
subplot(1,2,2); imshow(decoded_image_rs_low); title(‘Received Image (0 dB SNR, Error Correction)’);
figure;
subplot(1,2,1); imshow(decoded_image_high); title(‘Received Image (4 dB SNR, No Error Correction)’);
subplot(1,2,2); imshow(decoded_image_rs_high); title(‘Received Image (4 dB SNR, Error Correction)’);How to correct the following error in MATLAB? Code attached.
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that
dimension.
Error in Rev2 (line 26)
decoded_image_low = reshape(decoded_low, size(lenna_gray));
clc;
clear all;
% Load the lenna image
lenna = imread(‘lenna.png’);
% Convert image to grayscale
lenna_gray = rgb2gray(lenna);
% Convert pixel values to bits
lenna_bits = reshape(de2bi(lenna_gray), [], 1);
% BPSK modulation
Eb_No_low = 0; % Low SNR
Eb_No_high = 4; % High SNR
SNR_low = 10^(Eb_No_low/10);
SNR_high = 10^(Eb_No_high/10);
% Transmit and receive at low SNR
received_low = awgn(double(lenna_bits), SNR_low, ‘measured’);
% Demodulation
decoded_low = received_low < 0;
% Reshape decoded bits to original image size
decoded_image_low = reshape(decoded_low, size(lenna_gray));
% Plot original and received image at low SNR
figure;
subplot(1,2,1); imshow(lenna_gray); title(‘Original Image’);
subplot(1,2,2); imshow(decoded_image_low); title(‘Received Image (0 dB SNR)’);
% Transmit and receive at high SNR
received_high = awgn(double(lenna_bits), SNR_high, ‘measured’);
% Demodulation
decoded_high = received_high < 0;
% Reshape decoded bits to original image size
decoded_image_high = reshape(decoded_high, size(lenna_gray));
% Plot original and received image at high SNR
figure;
subplot(1,2,1); imshow(lenna_gray); title(‘Original Image’);
subplot(1,2,2); imshow(decoded_image_high); title(‘Received Image (4 dB SNR)’);
% Linear error detection code
% Example: Hamming (7,4) code
parityMatrix = [1 1 1 0 1 0 0; 1 1 0 1 0 1 0; 1 0 1 1 0 0 1];
generatorMatrix = [eye(4) parityMatrix’];
% Encode the data
encoded_data = mod(lenna_bits * generatorMatrix, 2);
% Add noise for linear error detection code
received_data = awgn(double(encoded_data), Eb_No_low, ‘measured’);
% Syndrome lookup table for error detection
syndrome_table = syndtable(parityMatrix);
% Decoding with error detection
decoded_data = zeros(size(encoded_data));
errors = zeros(size(encoded_data, 1), 1);
for i = 1:size(encoded_data, 1)
syndrome = mod(received_data(i, 🙂 * parityMatrix’, 2);
if sum(syndrome) ~= 0 % Error detected
errors(i) = 1;
else
decoded_data(i, 🙂 = received_data(i, :);
end
end
% Count number of retransmission requests at different SNRs
SNRs = [0, 2, 4, 6, 8, 10];
retransmissions = zeros(size(SNRs));
for i = 1:length(SNRs)
SNR = 10^(SNRs(i)/10);
received_data = awgn(encoded_data, SNR, ‘measured’);
errors = zeros(size(encoded_data, 1), 1);
for j = 1:size(encoded_data, 1)
syndrome = mod(received_data(j, 🙂 * parityMatrix’, 2);
if sum(syndrome) ~= 0 % Error detected
errors(j) = 1;
retransmissions(i) = retransmissions(i) + 1;
end
end
end
% Plot number of retransmissions against SNR values
figure;
plot(SNRs, retransmissions, ‘-o’);
xlabel(‘SNR (dB)’);
ylabel(‘Number of Retransmissions’);
title(‘Number of Retransmissions vs SNR’);
% Error correction code
% Example: Reed-Solomon code
n = 255;
k = 223;
t = 16;
rs_encoder = comm.RSEncoder(n, k);
rs_decoder = comm.RSDecoder(n, k);
% Encode data
encoded_rs = step(rs_encoder, double(lenna_bits));
% Add noise for Reed-Solomon code
received_rs_low = awgn(double(encoded_rs), Eb_No_low, ‘measured’);
received_rs_high = awgn(double(encoded_rs), Eb_No_high, ‘measured’);
% Decode received data
decoded_rs_low = step(rs_decoder, received_rs_low);
decoded_rs_high = step(rs_decoder, received_rs_high);
% Reshape decoded bits to original image size
decoded_image_rs_low = reshape(decoded_rs_low, size(lenna_gray));
decoded_image_rs_high = reshape(decoded_rs_high, size(lenna_gray));
% Plot original and received images with error correction
figure;
subplot(1,2,1); imshow(decoded_image_low); title(‘Received Image (0 dB SNR, No Error Correction)’);
subplot(1,2,2); imshow(decoded_image_rs_low); title(‘Received Image (0 dB SNR, Error Correction)’);
figure;
subplot(1,2,1); imshow(decoded_image_high); title(‘Received Image (4 dB SNR, No Error Correction)’);
subplot(1,2,2); imshow(decoded_image_rs_high); title(‘Received Image (4 dB SNR, Error Correction)’); How to correct the following error in MATLAB? Code attached.
Error using reshape
Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that
dimension.
Error in Rev2 (line 26)
decoded_image_low = reshape(decoded_low, size(lenna_gray));
clc;
clear all;
% Load the lenna image
lenna = imread(‘lenna.png’);
% Convert image to grayscale
lenna_gray = rgb2gray(lenna);
% Convert pixel values to bits
lenna_bits = reshape(de2bi(lenna_gray), [], 1);
% BPSK modulation
Eb_No_low = 0; % Low SNR
Eb_No_high = 4; % High SNR
SNR_low = 10^(Eb_No_low/10);
SNR_high = 10^(Eb_No_high/10);
% Transmit and receive at low SNR
received_low = awgn(double(lenna_bits), SNR_low, ‘measured’);
% Demodulation
decoded_low = received_low < 0;
% Reshape decoded bits to original image size
decoded_image_low = reshape(decoded_low, size(lenna_gray));
% Plot original and received image at low SNR
figure;
subplot(1,2,1); imshow(lenna_gray); title(‘Original Image’);
subplot(1,2,2); imshow(decoded_image_low); title(‘Received Image (0 dB SNR)’);
% Transmit and receive at high SNR
received_high = awgn(double(lenna_bits), SNR_high, ‘measured’);
% Demodulation
decoded_high = received_high < 0;
% Reshape decoded bits to original image size
decoded_image_high = reshape(decoded_high, size(lenna_gray));
% Plot original and received image at high SNR
figure;
subplot(1,2,1); imshow(lenna_gray); title(‘Original Image’);
subplot(1,2,2); imshow(decoded_image_high); title(‘Received Image (4 dB SNR)’);
% Linear error detection code
% Example: Hamming (7,4) code
parityMatrix = [1 1 1 0 1 0 0; 1 1 0 1 0 1 0; 1 0 1 1 0 0 1];
generatorMatrix = [eye(4) parityMatrix’];
% Encode the data
encoded_data = mod(lenna_bits * generatorMatrix, 2);
% Add noise for linear error detection code
received_data = awgn(double(encoded_data), Eb_No_low, ‘measured’);
% Syndrome lookup table for error detection
syndrome_table = syndtable(parityMatrix);
% Decoding with error detection
decoded_data = zeros(size(encoded_data));
errors = zeros(size(encoded_data, 1), 1);
for i = 1:size(encoded_data, 1)
syndrome = mod(received_data(i, 🙂 * parityMatrix’, 2);
if sum(syndrome) ~= 0 % Error detected
errors(i) = 1;
else
decoded_data(i, 🙂 = received_data(i, :);
end
end
% Count number of retransmission requests at different SNRs
SNRs = [0, 2, 4, 6, 8, 10];
retransmissions = zeros(size(SNRs));
for i = 1:length(SNRs)
SNR = 10^(SNRs(i)/10);
received_data = awgn(encoded_data, SNR, ‘measured’);
errors = zeros(size(encoded_data, 1), 1);
for j = 1:size(encoded_data, 1)
syndrome = mod(received_data(j, 🙂 * parityMatrix’, 2);
if sum(syndrome) ~= 0 % Error detected
errors(j) = 1;
retransmissions(i) = retransmissions(i) + 1;
end
end
end
% Plot number of retransmissions against SNR values
figure;
plot(SNRs, retransmissions, ‘-o’);
xlabel(‘SNR (dB)’);
ylabel(‘Number of Retransmissions’);
title(‘Number of Retransmissions vs SNR’);
% Error correction code
% Example: Reed-Solomon code
n = 255;
k = 223;
t = 16;
rs_encoder = comm.RSEncoder(n, k);
rs_decoder = comm.RSDecoder(n, k);
% Encode data
encoded_rs = step(rs_encoder, double(lenna_bits));
% Add noise for Reed-Solomon code
received_rs_low = awgn(double(encoded_rs), Eb_No_low, ‘measured’);
received_rs_high = awgn(double(encoded_rs), Eb_No_high, ‘measured’);
% Decode received data
decoded_rs_low = step(rs_decoder, received_rs_low);
decoded_rs_high = step(rs_decoder, received_rs_high);
% Reshape decoded bits to original image size
decoded_image_rs_low = reshape(decoded_rs_low, size(lenna_gray));
decoded_image_rs_high = reshape(decoded_rs_high, size(lenna_gray));
% Plot original and received images with error correction
figure;
subplot(1,2,1); imshow(decoded_image_low); title(‘Received Image (0 dB SNR, No Error Correction)’);
subplot(1,2,2); imshow(decoded_image_rs_low); title(‘Received Image (0 dB SNR, Error Correction)’);
figure;
subplot(1,2,1); imshow(decoded_image_high); title(‘Received Image (4 dB SNR, No Error Correction)’);
subplot(1,2,2); imshow(decoded_image_rs_high); title(‘Received Image (4 dB SNR, Error Correction)’); reshape error MATLAB Answers — New Questions
Public views requires login
When accessing public charts via link it shows message that i was logged out and wants me to login. I am using it with users which dont have mathworks account. Is this any new feature or Bug?When accessing public charts via link it shows message that i was logged out and wants me to login. I am using it with users which dont have mathworks account. Is this any new feature or Bug? When accessing public charts via link it shows message that i was logged out and wants me to login. I am using it with users which dont have mathworks account. Is this any new feature or Bug? thingspeak MATLAB Answers — New Questions