Réponse apportée
Hello everyone.How to modify the judgment code below and add'This is correct' and'This is wrong'?
As mlint is already warning you: 0.125<lamda1<3 is not doing what you think it does. Use this instead: if 0.125<lamda1 && lambd...

plus de 5 ans il y a | 0

Réponse apportée
How can i plot it
You have two surfaces: theta = linspace(0,2*pi,30); phi = linspace(0,pi/2,30); [theta,phi] = meshgrid(theta,phi); r = 3; ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to get data from a website
I can't tell you what you did wrong, because you decided not to post what you have tried. That meant I had to write your code fr...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Build a relay on code
You should sketch the two behaviors (don't use i or j as a variable name, and use comments to describe what your code is doing):...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to randomly select sub-sets from an array?
Read your data to a Matlab variable (even load might work here). Generate a vector of 1000 integers between 1 and 51360-48. The...

plus de 5 ans il y a | 0

Réponse apportée
Why is extractFileText Much Slower than fileread for Text Files?
fileread is very basic. It will often not work for files that are encoded with UTF-8 and can only handle plain text files. That ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
WebAPP Server 2020b File download using uiputfile
The uiputfile returns a full path as the second output, see the documentation. You can test if the path it returns fits within y...

plus de 5 ans il y a | 0

Réponse apportée
R code to MatLab?
The consensus seems to be that you should invoke R from the command line. You can use the RunRcode FEX submission.

plus de 5 ans il y a | 0

Réponse apportée
How can I add a legend in a for loop?
The best way is probably to use the DisplayName input for plot. You would have to be a bit careful about the order in which your...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Change multiple push buttons with one push button?
You can make the shift callback change a flag. That flag should be stored in the guidata struct. In the other callbacks you can ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Implement double summation in Matlab
The sigma symbol contains all syntactic elements that you need for a for loop: y=0;%initialize to 0 for j=1:N for i=1:j...

plus de 5 ans il y a | 0

Réponse apportée
Replace values in a matrix
Because you are only using integers, you can even use indexing to do the replacement: A=[NaN NaN NaN 3 3 3 2 NaN...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Save workspace with same load file name
You can use code like this in a loop. file_name_including_dot_txt='example.txt'; data=function_that_reads_your_file(file_name_...

plus de 5 ans il y a | 2

| A accepté

Réponse apportée
define end of line (eol) as unix (\n) not Windows (\r\n) using writecell
You can hack a solution together: Write the file with CRLF with writecell Read the file as a text file (e.g. with readfile or ...

plus de 5 ans il y a | 1

Réponse apportée
fopen files in one dataset
You don't use either filename when calling fopen. How is Matlab supposed to know which file you mean? I would suggest using eit...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Iterating through a structure
You can index a struct in a loop: rx = no_afr_stru(n).X(1:end-1); ry = no_afr_stru(n).Y(1:end-1);

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Randomized array with limits
A=1:3;A(4)=randi(3); mp=A(randperm(end))

plus de 5 ans il y a | 0

Réponse apportée
Converting data from two cell arrays in one vector
Je zou je klasgenoot kunnen vragen, ik heb gisteren bijna de zelfde vraag beantwoord: link. Continuing in English: that shoul...

plus de 5 ans il y a | 0

Réponse apportée
Sort categorical variables in an alphabetical order
As Ive Ive suggested: the sort function will do what you need: B = categorical({'NY','Boston'}); sort(B)

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
A neat reliable way to add up section of a matrix
Loops tend to do the trick: A = repmat(1:10,10,1); B = repmat(1:8,10,1); C = repmat(1:6,10,1); D = repmat(1:4,10,1); E = re...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Take maximum of different cell arrays in cell array
In each cell there is a double, and some elements are empty. You can either use a loop or use cellfun. B=cellfun(@max,d...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Read a list of filenames in a text file
If you are using R2020b you can use the readlines function to read the content of a file to a string array. You can also get the...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Warning: Name is nonexistent or not a directory error
I have seen the suggestion to use the 'set path' window to remove the temporary folder from the path. That worked for me. In th...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
how to speed up basic image processing tasks
Most basic tasks can be vectorized. But for your code there is something that makes an even larger difference: you don't have a ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
how to solve (5x1) matrix?
I believe I can mimic the shortest answer I have seen on this forum: \ To give this answer a bit more substance: you need to...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to change figure properties for all figures in MATLAB?
set(groot,'defaultFigureCreateFcn',@(fig,~)SomeFunction(fig))

plus de 5 ans il y a | 0

Réponse apportée
How to read greek characters in a .txt file
You can get my readfile function from the FEX. If you are using R2017a or later, you can also get it through the AddOn-manager.

plus de 5 ans il y a | 0

Réponse apportée
MATLAB taking too much memory on SD card
I'm guessing you have a fairly large sector size on your SD card. Most file systems store files in sections called sectors. If ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
end indexing function as method input
If you create a dummy property (which is only used so Matlab treats your method as a property), you can use the overloaded subsr...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Error in hand written code
I personally prefer not to use load for text files, as it isn't obvious from the context that the specific text file will actual...

plus de 5 ans il y a | 0

Charger plus