Respondida
passing handle objects by value
You don't need to. classdef aclass < handle properties a end end l={} a = aclass(); a.a = 10; l{e...

casi 5 años hace | 0

Respondida
Why this simple for loop doesn't work?
Use a debugger to check why.

casi 5 años hace | 0

Respondida
Unkown error my code is running 5 out of 10times randomly. i'm not changing anything but still runs sometime and throws error sometimes in random order
Why do you use 'elseif' below? Change it to just 'else'? function angle = Phase(C,i,j) if real(C(i,j)) >= 0 angle...

casi 5 años hace | 0

Respondida
How can i use C++ DLL in Simulink?
Did you try to use 'addheader' of loadlibrary? The error seems to be related to header files. https://www.mathworks.com/help/ma...

casi 5 años hace | 0

Respondida
How do you draw such dynamic diagrams that change over time?
Try this: https://www.mathworks.com/matlabcentral/fileexchange/74003-barchartrace

casi 5 años hace | 0

Respondida
I get this error when i try to load RL agents. Please Help!
Inside pfcagent.mat, the variable saved is not called "saved_agent". It must be called something else. That is why the first li...

casi 5 años hace | 0

| aceptada

Respondida
Problems with redirected stdin and stdout when using py to run python code
Did you try: system('python -c "import ztest; ztest.ztest()"')

casi 5 años hace | 0

Respondida
Calling Python function with multiple outputs in Simulink
Which version of matlab and python are you using? I tested 2021a, and calling py.testQ.test(x, y) returns a Python tuple. ret ...

casi 5 años hace | 0

Respondida
Convert Python code to matlab
One possible approach is to call python from matlab. Please refer this this. https://www.mathworks.com/matlabcentral/answers/58...

casi 5 años hace | 0

Respondida
Adding elements to array without repeating
This will work: result = [F.a F.b F.c]; result = unique(result);

casi 5 años hace | 0

| aceptada

Respondida
How can I find a character in a string?
ismember is the function you are looking for.

casi 5 años hace | 1

| aceptada

Respondida
Estimation of a unknown matrix from the other known matrices
B=A/C;

casi 5 años hace | 0

Respondida
[MATLAB Compiler] I want to run a Python package created on Linux on Windows. I get an error when specifying the path to the folder.
Did you try: filename = ['C:/test/file.csv']; Or filename = ['C:\\test\\file.csv']; '\t' has special meaning, and it might c...

casi 5 años hace | 0

| aceptada

Respondida
indexing a loop to run through multiple files
Try this: %% input csv files file = dir('*.csv'); %read the files into matlab num_files = length(file); %record how many file...

casi 5 años hace | 0

| aceptada

Respondida
Adding elements to array without repeating
Use ismember(233, F.a) before adding it to F.a.

casi 5 años hace | 0

Respondida
How to realize the variable number of input parameters
How about input two arrays of coordinates? x=[1,2,3,4], y=[5,6,7,8] for example? Your function takes input of two arrays. It doe...

casi 5 años hace | 0

| aceptada

Respondida
Getting the wrong output value when running the code
It is a simple function here. This kind of error can be easily found using matlab debugger. Set a break point in the loop, and h...

casi 5 años hace | 0

| aceptada

Respondida
Random sample and percentage
Try this? column_count = 100; % your columns row_count = 200; % your rows percentage_to_take = 0.2; % you take 20% of total ...

casi 5 años hace | 0

Respondida
MATLAB Fedora 34 installer gui issues
How about running a VM of debian and install matlab there?

casi 5 años hace | 0

Respondida
Extract equivalent RGB without transparency from PNG with alpha channel
For each color channel, try re = (1-alpha)*foreground + alpha*background. Since here background is white, so each channel, b...

casi 5 años hace | 0

| aceptada

Respondida
How do I access previous answers to my question?
From this page, select 'My MATLAB Answers" drop down. Then select "My questions".

casi 5 años hace | 0

| aceptada

Respondida
Matlab is very slow on macOS Big Sure
Open a terminal window from MacOS and type top This will tell you which process is taking most of the CPU time. Also what is ...

casi 5 años hace | 0

Respondida
Running python script in C S-function Simulink
Can you change your python code to write to a file? Then your matlab code can read from the file to get the output.

casi 5 años hace | 0

Respondida
How to create a bus communication with System Composer ?
Yes, it is doable. First create the bus from the source to the first destination. Then hold down the control key of your keyboa...

casi 5 años hace | 1

Respondida
Delete all rows from a cell array
arr = cell2mat(cellArray); % convert to array first arr(arr>7) = []; % remove cellArray = num2cell(arr); % convert back

casi 5 años hace | 0

Respondida
Create a matrix of element (points) connectivity
Can you just change m=3; n=3; for 9 ponts?

casi 5 años hace | 0

Respondida
How can i reshape a matrix to my preferred dimension and discard the excess element
What is the original matrix you want to reshape? Is it signal? If so, how about reshaped = signal(1:fl, :)

casi 5 años hace | 0

Respondida
how to caculate distance?
Can you figure out the coordinates of those three dots? If so that the distance is defined as d=sqrt((x1-x2)^2+(y1-y2)^2)). Here...

casi 5 años hace | 1

Respondida
How to find MATLAB function blocks??
Once you find the root of state flow using sfroot, you can use the find function as you used above. In addtion you can add a new...

casi 5 años hace | 0

Respondida
construct a complex number using real part and abs data
This is really a math question. When you have the real part and the absolute value, the imaginary part is not determined in gene...

casi 5 años hace | 0

Cargar más