Questions tagged [matlab]

Programming questions about MATLAB are off topic and should be asked on Stack Overflow. MATLAB is a high-level language and interactive programming environment developed by MathWorks. It is the foundation for a number of other tools, including Simulink and various toolboxes that extend the core capabilities.

Filter by
Sorted by
Tagged with
1
vote
0answers
9 views

How do you use git from matlab online?

I'm using matlab from https://matlab.mathworks.com/ Is there any way to use git from there? the interface doesn't seem very enlightning. Matlab help assumes you have a local matlab installation.
0
votes
0answers
7 views

How can I express this nested for loop in MATLAB in a more efficient and compact way? [closed]

I am performing this following nested for loop in some optimization toolbox. The solver takes a lot of time. I want to express this in a different way to see if this will speed up my processing time. ...
0
votes
0answers
10 views

reinforcement learning algorithm that is deployed online on a time varying system [closed]

I am trying to program a reinforcement learning algorithm that has to learn and control a system at the same time. I have one year hourly load data that impact the system, and I want to design an ...
0
votes
0answers
27 views

How to use right audio and left audio seperately in windows?

I am designing a signal combining module for my bachelors project.The initial concept is that i use my laptops audio jack as source. Yet to test my concept i need two sepearate signals. I know aux ...
0
votes
0answers
6 views

Can someone please help me interpret this MATLAB code for LU decomposition using Doolittle's Method? [migrated]

I was wondering whether someone could help interpret this code for me line-by-line. It basically decomposes a square matrix into a lower (L) and upper (U) triangular matrix using Doolittle's Method. ...
0
votes
0answers
5 views

Why N point FFT of a undersampled signal in time domain is worse than only a N point FFT of the time domain signal (Not resampled) [migrated]

I am trying to understand what happens when I try to reconstruct the spectrum of a signal with fewer samples. I tried 2 approaches. I resample the time domain signal based on the number of samples (N) ...
0
votes
0answers
5 views

On Matlab while running this code I am getting this error, Z must be a matrix, not a scalar or vector [migrated]

I am unable to generate mesh or surf while using this code z must be a matrix, not a scalar or vector r= 5; theta= 60 ; ro=5; w1=200; w2=300; t=0:1:60; dt=diff(t); x=ro*cos(w1.*t)+r.*cos(theta+(w1+w2)...
0
votes
0answers
3 views

Remove line at value in plot in MATLAB [migrated]

Is it possible to remove the small line near the axis-value in plots (See image)? MATLAB-Image
0
votes
0answers
6 views

Matlab, Pycharm, Clion started with froze window if without sudo

I am having problems staring Matlab, Pycharm, Clion in Ubuntu 20.04. After installation, when I tried to launch them, they froze immediately. Their windows didn't response to any mouse/keyboard ...
0
votes
0answers
10 views

Arduino and Matlab Serial communication is slow

I am sending 10k data from MKR Zero Arduino to MATLAB with serial communcation. The data is finished sending from the Arduino in 3 seconds but the Matlab connot catch up the speed and take more than 5 ...
0
votes
0answers
28 views

Matlab kernel to VS Code

I would like to know how to call Matlab kernel from VS Code. https://www.reddit.com/r/matlab/comments/e6ohzp/can_i_use_matlabs_terminal_in_visual_studio_code/ I read this. I added Matlab to the ...
0
votes
0answers
10 views

Double error message when starting Matlab : “ Code execution cannot proceed…”

I am trying to launch Matlab from : Matlab/R2019b/bin/ . After clicking the application icon, I am given the following two error messages in succession : "The code execution cannot proceed ...
0
votes
1answer
68 views

How to use full 256GB RAM of my work station? MATLAB only seems to be using 75GB of RAM and not the 256GB that is available

I have a workstation that has 256GB RAM and 32 cores. However, when I am running some high-end simulations, the maximum used memory by the MATLAB is 33% (75 GB) and it never increases. The simulations ...
0
votes
0answers
11 views

MATLAB Simulation speed in Simulink Test, when the model contains referenced models

I have a model that contains 20 referenced models. With the MATLAB default settings, it takes about 90 seconds to simulate the model. I've set the Rebuild option in Model Referencing of Configuration ...
0
votes
0answers
37 views

Matlab App designer “Design View” as PDF/TIFF

Is there a way to save the Matlab App designer "Design View" as PDF or any other graphic format in high-quality/High DPI. I tried to use Ctrl+PrintScr and the quality is super bad.
0
votes
0answers
121 views

ERR_SSL_SERVER_CERT_BAD_FORMAT(-167)

I start using Matlab on Linux for my internship. When I launch simulink, I often get the Simulink's toolbar replaced by this message: I'm on Ubuntu 18.04 LTS. I tried to open the port 31515 but no ...
0
votes
0answers
44 views

How to change the current folder in Matlab?

I installed MATLAB but when I open it, it always starts at "C:\Windows\System32" folder but when I use "userpath" command it shows "C:\Users\Home\Documents\ MATLAB". How can I fix this problem?
0
votes
0answers
41 views

Plot a velocity profile in matlab

In my code below I want to plot the velocity profile in 3d for pipe with redius R. I get the plot but the problem is the velocity shows zero value just at the 4 corner not in a circle. So I used the ...
-1
votes
1answer
88 views

How can I solve the Error: 358 when activating MATLAB R2019b?

"Error 358: The license file expiration date has passed. In order to activate this license, the license file expiration date must be set to a future date."
61
votes
12answers
39k views

Can I run my CPU at 100% usage for a long time?

I have a Dell XPS 15 9570, 32 GB ram, 2.2 ghz and 6 cores. When i use an application (The parsim command on MATLAB) (for more details) then my fan starts running fast , during this my PC doesn't seem ...
1
vote
1answer
487 views

Merge 3 .csv into one file with different number of columns

I have 3 .csv files and I want to merge them together to one .csv file which can be in R or Matlab. The files are: 1597 obs of 167 variables; 160 obs of 167 variables; 533 obs of 146 variables I ...
1
vote
0answers
24 views

Matlab refuses to compute a limit [closed]

I have some function handle which has a variable input x, along with some parameters. I am trying to compute the limit when x goes to zero from above of that function, for different values of the ...
0
votes
1answer
41 views

MatLab showing different plots on different zoom level

I ran this code on MatLab: function main fimplicit (@(x,y)f(x,y),[2 5]) end function fun = f(x,y) nc=1.45; %cladding nf=1.5; ns=1.4; %substrate h=5; %width of waveguide kappa=sqrt(x^2*nf^2-y.^...
2
votes
1answer
157 views

How to get different color for different branches in a plot in MatLab, Mathematica and Desmos

I am trying to obtain slab-waveguide dispersion plot like this (dashed line): I tried following code in Matlab: function main fimplicit (@(x,y)f(x,y),[0 10]) end function fun = f(x,y) nc=1.45; %...
2
votes
1answer
26 views

Linking JVM languages other than Java with Matlab

I'm aware that it's possible to link Java programs with Matlab. Is it therefore possible to link any JVM languages with Matlab? I would suspect that's the case -- presumably Matlab can't tell and ...
0
votes
1answer
56 views

Values of Components in a Matlab app are not updated while a loop is running

I have created an app using the App Designer in Matlab. I have a check box called CheckBox and want to access its value from inside a loop, e.g. display it in the console. The way this could be done ...
0
votes
1answer
62 views

MATLAB: Growing an array and logical indexing

I create the following array in MATLAB: Now I find which elements of x are greater than 4: So far so good. Now I create an array of length 8: And now I execute this command: I am very confused as ...
0
votes
0answers
116 views

Could not access the MATLAB Runtime component cache

I am running a matlb program compiled for windows on debian / linux. I have installed the Matlab runtime for windows on the machine using wine. Currently when i try to run the program using wine by ...
0
votes
2answers
175 views

Matlab solve command gives four equations instead of 2 real solutions

I am trying to solve the following equation:x^4 - 3*x^3 + x^2 - 1 by doing: solve(x^4 - 3*x^3 + x^2 - 1 == 0) I am expecting either two real solutions or four solutions where two of them are real and ...
0
votes
1answer
33 views

“gcs” returns nothing in MATLAB

After I restarted my PC and then re-opened a .m script I was working on, that for some reason broke it. gcs for some reason returns 0×0 empty char array when it's supposed to return the pathname of ...
0
votes
1answer
36 views

Matlab syntax (1:end-1) - Explanation

Could someone explain me this code? meas.jerk.time = (meas.acc.time(1:end-1) + meas.acc.time(2:end)) ./ 2; Assuming that meas.acc.data and meas.acc.time are vectors with the same number of elements, ...
0
votes
0answers
54 views

MATLAB - Error using interp1>reshapeAndSortXandV X and V must be of the same length

I geht this error message when I try to derive my acceleration of the car. I think there is a size problem, but I don't know how to solve it. The data is measured from a car. meas.jerk.data = diff(...
1
vote
0answers
28 views

Opening MATLAB scripts by double click on linux

I associated '.m scripts with Matlab, but still, I have a problem. When I open two files of this type, I open 'two Matlabs' also. I want to have a similar result as in Windows. I open two scripts, ...
0
votes
0answers
14 views

MATLAB output array

I'm a beginner and I got a Script and I have to out put RES{1} and RES{2} RES{ii,1} = measure; RES{ii,2} = measure_filter; measure and measure_filter will be filled before. But I don't know how to ...
0
votes
1answer
34 views

MATLAB: recall previous command and ADD it to what I typed (similar to bash)

On the MATLAB commandline, I can recall the previous command with the UP arrow. However, if I already have typed something and then hit UP arrow, only commands beginning with what I already typed will ...
0
votes
1answer
18 views

How to make an application “recognized” as an application

I'm using ubuntu and i3 window manager. To launch matlab I have to navigate to /usr/local/MATLAB/R2019a/bin and type ./matlab. Other applications like firefox and atom are recognized as ...
1
vote
0answers
40 views

Here HDLM in Matlab, App ID and App code credentials validation

I created a Freeminum account in Here technologies website and generated the App ID and App code. I tried to use those credentials in the HERE HDLM feature in the Automated driving Toolbox in Matlab. ...
0
votes
1answer
39 views

Is there any way to tell MATLAB to close/exit all open executables/MEX files?

I am currently working on a project that uses MATLAB and MEX files. I frequently make changes to the MEX source files for testing, and then go to replace these files with my newly-compiled ones. ...
0
votes
1answer
38 views

Assistance with forming normal vectors on the graph

I am doing an assignment question link to image I am trying to find the normal vectors to my 'ice-cream' cone curve, which consists of a part cone and part sphere. I need help with the code because I ...
0
votes
1answer
285 views

Matlab fit function not accepting “numeric” data type

This is driving me crazy, I'm just trying to fit a gaussian curve to some data using Matlab's fit function (r2017a). gaussEqn = 'a*exp(-((x-b)/c)^2)+d' f = fit(x,y,gaussEqn); But I get this error: ...
1
vote
0answers
84 views

How to create a 3D plot with orthographic projections – Matlab

How can I generate a 3D plot with the orthographic projections of a parametric curve on the inside walls of the 3D plot, as shown in this youtube video? I can generate a 3D plot of the curve using ...
1
vote
0answers
58 views

Create a 3D space for dots moving in a given direction

I have written a code that animates 2d dots moving in a certain direction. I tried to create a 3rd dimension using spherical coordinates, and for that I used two times the psychtoolbox function Screen(...
0
votes
1answer
26 views

Parametric plotting on MATLAB

I am working on a quantitative finance problem, and I wish to plot the following functions: mu= 0.1*w+0.14*(1-w) and sigma = (0.12^2)*w^2+0.4*0.12*0.2*2*w(1-w)+(0.2^2)*(1-w)^2; for w between 0 and 1. ...
0
votes
1answer
131 views

MathWorks is written for Lego firmware V1.03, but Lego is up to V1.10

MathWorks (MATLAB and Simulink) is/are written for Lego firmware 1.03! (with no TelNet ID/passkey) Versions 1.07 and 1.08 also do not require the ID/passkey. Versions 1.09 and 1.10 do require an ID/...
0
votes
1answer
17 views

When I try to install matplotlab library getting the error mentioned in the description

When I try to install matplotlab library in my python 3.7.3, I am getting the below error, Could not find a version that satisfies the requirement matplotlab (from versions: ) No matching ...
0
votes
1answer
298 views

Editing Individual Bar Colors in MATLAB

I am writing a sample code in MATLAB to display profit of a business over a certain amount of time. So far I have plotted the following with relative ease. time = {'4 weeks','12 weeks','24 weeks','27 ...
0
votes
2answers
48 views

Windows: make application installed in Program Files seen like it has no spaces

I have Matlab installed in 'Program Files', and I need to install the toolbox that requires a path without any spaces. The problem is I can't perform reinstallation of that program in another location....
0
votes
0answers
85 views

Matlab/Simulink: How to programmatically edit the Solar Cell component?

I am trying to programmatically add components to a Simulink model. The programmatic model editing logic of MATLAB is very straight-forward (reference), but here I run into an issue. I am struggling ...
1
vote
1answer
310 views

How to revert GCC installation on Centos 7

I recently installed gcc 6.3.0 following the instructions on this site as it is the supported compiler for the 2018b release of Matlab and Simulink. However due to compatibility issues with other ...
0
votes
0answers
508 views

Passing arguments to MATLAB script/function

I'm trying to pass arguments to my MATLAB script via this command in a Terminal running Bash: matlab -nodisplay -nosplash -nodesktop -r "K18 1 20 'file.csv'" -logfile log.log The K18.m file looks ...

1
2 3 4 5 6